emit txs.
This commit is contained in:
parent
89246d85e6
commit
28216754df
@ -15,9 +15,13 @@ bitcoind.start(function(err) {
|
|||||||
bitcoind.on('open', function(status) {
|
bitcoind.on('open', function(status) {
|
||||||
console.log('bitcoind: status="%s"', status);
|
console.log('bitcoind: status="%s"', status);
|
||||||
// getBlocks(bitcoind);
|
// getBlocks(bitcoind);
|
||||||
bitcoind.on('block', function(block) {
|
// bitcoind.on('block', function(block) {
|
||||||
console.log('Found block:');
|
// console.log('Found block:');
|
||||||
console.log(block);
|
// console.log(block);
|
||||||
|
// });
|
||||||
|
bitcoind.on('tx', function(tx) {
|
||||||
|
console.log('Found tx:');
|
||||||
|
console.log(tx);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -146,8 +146,15 @@ Bitcoin.prototype.start = function(callback) {
|
|||||||
|
|
||||||
self.emit('block', block);
|
self.emit('block', block);
|
||||||
|
|
||||||
return setImmediate(function() {
|
return utils.forEach(block.tx, function(tx, nextTx) {
|
||||||
nextBlock();
|
self.emit('tx', tx);
|
||||||
|
return setImmediate(function() {
|
||||||
|
return nextTx();
|
||||||
|
});
|
||||||
|
}, function() {
|
||||||
|
return setImmediate(function() {
|
||||||
|
return nextBlock();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}, function() {
|
}, function() {
|
||||||
return setTimeout(next, self.pollInterval);
|
return setTimeout(next, self.pollInterval);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user