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