Skip to content

Commit

Permalink
Exclude immature coinbase outputs for listunspent.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jun 26, 2014
1 parent 206d552 commit 3ab6db5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions acctmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 3ab6db5

Please sign in to comment.