diff --git a/createtx.go b/createtx.go index 0a0f98e..06dd4fc 100644 --- a/createtx.go +++ b/createtx.go @@ -126,7 +126,7 @@ func selectInputs(s tx.UtxoStore, amt uint64, minconf int) (inputs []*tx.Utxo, b // to a change address, resulting in a UTXO not yet mined in a block. // For now, disallow creating transactions until these UTXOs are mined // into a block and show up as part of the balance. - if utxo.Height != -1 && int(bs.Height-utxo.Height) >= minconf { + if confirmed(minconf, utxo.Height, bs.Height) { eligible = append(eligible, utxo) } } diff --git a/createtx_test.go b/createtx_test.go index b9f5070..42b8378 100644 --- a/createtx_test.go +++ b/createtx_test.go @@ -118,7 +118,7 @@ func TestFakeTxs(t *testing.T) { pairs := map[string]int64{ "17XhEvq9Nahdj7Xe1nv6oRe1tEmaHUuynH": 5000, } - _, err = a.txToPairs(pairs, 0) + _, err = a.txToPairs(pairs, 1) if err != nil { t.Errorf("Tx creation failed: %s", err) return