diff --git a/lib/primitives/mtx.js b/lib/primitives/mtx.js index fab2e7d1..3c37dd27 100644 --- a/lib/primitives/mtx.js +++ b/lib/primitives/mtx.js @@ -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; };