Precondition check for TxProposals#deleteOne

This commit is contained in:
Ivan Socolsky 2014-08-28 11:03:47 -03:00
commit a07ffee068
2 changed files with 16 additions and 3 deletions

View file

@ -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];
};