refactor example.
This commit is contained in:
parent
1c69a1392f
commit
9681c58fc0
|
@ -212,6 +212,7 @@ bitcoind.on('open', function(status) {
|
|||
}
|
||||
|
||||
// Test fromHex:
|
||||
if (argv['from-hex']) {
|
||||
var block = bitcoind.block.fromHex(testBlock);
|
||||
assert.equal(block.hash, '0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af');
|
||||
assert.equal(block.merkleroot, '2fda58e5959b0ee53c5253da9b9f3c0c739422ae04946966991cf55895287552');
|
||||
|
@ -222,12 +223,15 @@ bitcoind.on('open', function(status) {
|
|||
bitcoind.log('Transaction:');
|
||||
bitcoind.log(tx);
|
||||
return;
|
||||
}
|
||||
|
||||
// Test all parsed packets:
|
||||
if (argv['packets']) {
|
||||
bitcoind.on('parsed', function(packet) {
|
||||
return bitcoind.log(packet);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
argv['on-block'] = true;
|
||||
setTimeout(function() {
|
||||
|
|
Loading…
Reference in New Issue