Correctly count unconfirmed txs in api GetXpub

pull/133/head v0.2.1
Martin Boehm 2019-03-06 18:48:15 +01:00
parent e06ff194de
commit efca04a3fb
1 changed files with 3 additions and 1 deletions

View File

@ -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)) {