Precondition check for TxProposals#deleteOne
This commit is contained in:
parent
25064829e0
commit
a07ffee068
2 changed files with 16 additions and 3 deletions
|
|
@ -45,9 +45,7 @@ TxProposals.prototype.getNtxids = function() {
|
|||
};
|
||||
|
||||
TxProposals.prototype.deleteOne = function(ntxid) {
|
||||
var txp = this.txps[ntxid];
|
||||
if (!txp)
|
||||
throw new Error('Unknown TXP: ' + ntxid);
|
||||
preconditions.checkState(this.txps[ntxid], 'Unknown TXP: ' + ntxid);
|
||||
delete this.txps[ntxid];
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue