Exclude immature coinbase outputs for listunspent.

Fixes #103.
This commit is contained in:
Josh Rickmar 2014-06-26 14:58:46 -05:00
parent 206d5526b0
commit 3ab6db5c7d

View file

@ -20,6 +20,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/conformal/btcchain"
"github.com/conformal/btcjson"
"github.com/conformal/btcutil"
"github.com/conformal/btcwallet/txstore"
@ -968,6 +969,11 @@ func (am *AccountManager) ListUnspent(minconf, maxconf int,
if int(confs) < minconf || int(confs) > maxconf {
continue
}
if credit.IsCoinbase() {
if !credit.Confirmed(btcchain.CoinbaseMaturity, bs.Height) {
continue
}
}
_, addrs, _, _ := credit.Addresses(activeNet.Params)
if filter {