mtx: coin selection - handle reorgd coinbases.
This commit is contained in:
parent
82d1345311
commit
c358a1b59e
@ -1562,6 +1562,14 @@ CoinSelector.prototype.isSpendable = function isSpendable(coin) {
|
||||
if (this.height === -1)
|
||||
return true;
|
||||
|
||||
if (coin.coinbase) {
|
||||
if (coin.height === -1)
|
||||
return false;
|
||||
|
||||
if (this.height + 1 < coin.height + maturity)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.confirmations > 0) {
|
||||
if (coin.height === -1)
|
||||
return this.confirmations <= 0;
|
||||
@ -1577,11 +1585,6 @@ CoinSelector.prototype.isSpendable = function isSpendable(coin) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (coin.coinbase) {
|
||||
if (this.height + 1 < coin.height + maturity)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user