Skip to content

Commit

Permalink
Correctly count unconfirmed txs in api GetXpub
Browse files Browse the repository at this point in the history
  • Loading branch information
martinboehm committed Mar 6, 2019
1 parent e06ff19 commit efca04a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/xpub.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,9 @@ func (w *Worker) GetXpubAddress(xpub string, page int, txsOnPage int, option Acc
}
// skip already confirmed txs, mempool may be out of sync
if tx.Confirmations == 0 {
unconfirmedTxs++
if !foundTx {
unconfirmedTxs++
}
uBalSat.Add(&uBalSat, tx.getAddrVoutValue(ad.addrDesc))
uBalSat.Sub(&uBalSat, tx.getAddrVinValue(ad.addrDesc))
if page == 0 && !foundTx && (useTxids == nil || useTxids(&txid, ad)) {
Expand Down

0 comments on commit efca04a

Please sign in to comment.