Use confirms func to find number of confirmations.

This commit is contained in:
Josh Rickmar 2014-04-13 23:06:25 -05:00
parent 2bb41582c9
commit 51fb9ad619

View file

@ -104,7 +104,7 @@ func selectInputs(utxos []*tx.RecvTxOut, amt int64,
if confirmed(minconf, utxo.Height(), bs.Height) { if confirmed(minconf, utxo.Height(), bs.Height) {
// Coinbase transactions must have 100 confirmations before // Coinbase transactions must have 100 confirmations before
// they may be spent. // they may be spent.
if utxo.IsCoinbase() && bs.Height-utxo.Height()+1 < 100 { if utxo.IsCoinbase() && confirms(utxo.Height(), bs.Height) < 100 {
continue continue
} }
eligible = append(eligible, utxo) eligible = append(eligible, utxo)