diff --git a/lib/node/http.js b/lib/node/http.js
index bb48d3a9..ae989fc8 100644
--- a/lib/node/http.js
+++ b/lib/node/http.js
@@ -305,6 +305,20 @@ class HTTP extends Server {
for (const hash of hashes)
result.push(util.revHex(hash));
+ if (hashes.length > 0) {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bitcoin-cli getblock 0000000000000000000b47042b90c6a893e6e5cdef70c92beefb88f4c5fa5a69 3 | |
{ | |
"hash": "0000000000000000000b47042b90c6a893e6e5cdef70c92beefb88f4c5fa5a69", | |
"confirmations": -1, | |
"strippedsize": 298, | |
"size": 334, | |
"weight": 1228, | |
"height": 584802, | |
"version": 541065216, | |
"versionHex": "20400000", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## PREHEAD | |
---------- | |
nonce (4 bytes) | |
| | |
| timestamp (8 bytes) | |
| | | |
| | padding (20 bytes) prevBlock (32 bytes) treeRoot(32 bytes) commitHash(32 bytes) | |
⚀⚀⚀⚀ ⚀⚀⚀⚀⚀⚀⚀⚀ ⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀ ⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀ ⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀ ⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀⚀ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": 1, | |
"network": "testnet", | |
"magic": 165176447, | |
"addrs": [ | |
{ | |
"addr": "aoihqqagbhzz6wxg43itefqvmgda4uwtky362p22kbimcyg5fdp54@172.104.214.189:13038", | |
"src": "apkt5lnm64d26ho57ne222s3uzlvzq3ee23a5sqaw3gjjhcn2b4lg@0.0.0.0:13038", | |
"services": "11", | |
"time": 1563264733, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should fund both wallets', async () => { | |
wdb.on('balance', (wallet, balance) => { | |
if (balance.confirmed === 2000 * 10 * 1e6) | |
wdb.emit(`balance trigger ${wallet.wid}`); | |
}); | |
const waitForBalance1 = new Promise( (resolve) => { | |
wdb.once('balance trigger 1', () => { | |
resolve(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-env mocha */ | |
/* eslint prefer-arrow-callback: "off" */ | |
'use strict'; | |
const assert = require('bsert'); | |
const Network = require('../lib/protocol/network'); | |
const FullNode = require('../lib/node/fullnode'); | |
const Address = require('../lib/primitives/address'); | |
const rules = require('../lib/covenants/rules'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const bcoin = require('../..'); | |
bcoin.set('regtest'); | |
// SPV chains only store the chain headers. | |
const chain = new bcoin.Chain({ | |
spv: true | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MTX | |
Estimate Size | |
159 158 'DIFF: 1' | |
✓ P2PK 1-in 1-out | |
193 192 'DIFF: 1' | |
✓ P2PKH 1-in 1-out | |
234 231 'DIFF: 3' | |
✓ Bare 2-of-3 Multisig 1-in 1-out | |
115 113 'DIFF: 2' | |
✓ P2WPKH 1-in 1-out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/blockstore/index.js b/lib/blockstore/index.js | |
index 7d7a6d21..198e1fba 100644 | |
--- a/lib/blockstore/index.js | |
+++ b/lib/blockstore/index.js | |
@@ -17,17 +17,18 @@ const FileBlockStore = require('./file'); | |
*/ | |
exports.create = (options) => { | |
- if (options.memory) { | |
+ const location = join(options.prefix, 'blocks'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#### | |
#### Alice, Bob and Charlie each individually run faucet-tool to generate keys | |
#### | |
$ bin/faucet-tool createaddress --show-keys -n regtest | |
Seed phrase (WRITE DOWN AND KEEP SECRET): | |
happy warfare fun fury vicious pistol dad sibling rare tissue hobby rich range solid purchase scrub trouble room little foam always also clay situate | |
Address: |