From 2bb41582c97af9adf5a399421041bc27e2de91f8 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Sat, 12 Apr 2014 12:26:40 -0500 Subject: [PATCH] Fix listsinceblock to consider target confirms. Closes #80. --- account.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/account.go b/account.go index 2df0922..73082d2 100644 --- a/account.go +++ b/account.go @@ -172,11 +172,18 @@ func (a *Account) CurrentAddress() (btcutil.Address, error) { func (a *Account) ListSinceBlock(since, curBlockHeight int32, minconf int) ([]btcjson.ListTransactionsResult, error) { var txList []btcjson.ListTransactionsResult for _, txRecord := range a.TxStore.SortedRecords() { - // check block number. + // Transaction records must only be considered if they occur + // after the block height since. if since != -1 && txRecord.Height() <= since { continue } + // Transactions that have not met minconf confirmations are to + // be ignored. + if !confirmed(minconf, txRecord.Height(), curBlockHeight) { + continue + } + txList = append(txList, txRecord.TxInfo(a.name, curBlockHeight, a.Net())...) }