spvnode: do not attempt to insert wdb txs twice.
This commit is contained in:
parent
0eaa26a374
commit
bb11cfc021
@ -140,26 +140,28 @@ SPVNode.prototype._init = function _init() {
|
||||
});
|
||||
|
||||
this.pool.on('tx', function(tx) {
|
||||
self.emit('tx', tx);
|
||||
|
||||
if (self.rescanJob)
|
||||
return;
|
||||
|
||||
self.walletdb.addTX(tx).catch(onError);
|
||||
self.emit('tx', tx);
|
||||
});
|
||||
|
||||
this.chain.on('block', function(block) {
|
||||
self.emit('block', block);
|
||||
});
|
||||
|
||||
this.chain.on('connect', function(entry, block) {
|
||||
this.chain.on('connect', co(function* (entry, block) {
|
||||
if (self.rescanJob) {
|
||||
self.watchBlock(entry, block).catch(onError);
|
||||
try {
|
||||
yield self.watchBlock(entry, block);
|
||||
} catch (e) {
|
||||
self._error(e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
self.emit('connect', entry, block);
|
||||
});
|
||||
}));
|
||||
|
||||
this.chain.on('disconnect', function(entry, block) {
|
||||
self.emit('disconnect', entry);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user