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