mempool: add double spend events.
This commit is contained in:
parent
7a1e539700
commit
3988d2766d
@ -823,6 +823,7 @@ Mempool.prototype.insertTX = co(function* insertTX(tx) {
|
|||||||
// not double-spending an output in the
|
// not double-spending an output in the
|
||||||
// mempool.
|
// mempool.
|
||||||
if (this.isDoubleSpend(tx)) {
|
if (this.isDoubleSpend(tx)) {
|
||||||
|
this.emit('conflict', tx);
|
||||||
throw new VerifyError(tx,
|
throw new VerifyError(tx,
|
||||||
'duplicate',
|
'duplicate',
|
||||||
'bad-txns-inputs-spent',
|
'bad-txns-inputs-spent',
|
||||||
@ -1895,6 +1896,8 @@ Mempool.prototype.removeDoubleSpends = function removeDoubleSpends(tx) {
|
|||||||
spent.tx.rhash());
|
spent.tx.rhash());
|
||||||
|
|
||||||
this.removeEntry(spent, true);
|
this.removeEntry(spent, true);
|
||||||
|
|
||||||
|
this.emit('double spend', spent);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user