mirror of
https://github.com/bitcoin-core/gui-qml.git
synced 2026-12-02 07:54:42 +00:00
Activity double-counts incoming replacements and misclassifies pending transactions #1072
Labels
No labels
Android
Bug
Build system
Design suggestion
Doc
Needs design review
Needs rebase
Stage
UX
Up for grabs
Upstream
Wallet
duplicate
enhancement
good first issue
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
bitcoin-core/gui-qml#1072
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An ordinary fee bump of an incoming payment makes Activity count both the original and replacement as pending receipts.
I reproduced a single 0.005 BTC payment appearing as 0.01 BTC pending, even though only the replacement remained in the mempool and Core’s
getbalancescorrectly reported 0.005 BTC pending.Steps to reproduce
bumpfee <original_txid> '{"fee_rate":20}', keeping the receiving address and payment amount unchanged.getbalances,gettransaction, and the node’s mempool.Before confirmation, Activity shows two active, Unconfirmed receipts of 0.005 BTC each and a 0.01 BTC pending total. Core reports only 0.005 BTC pending, and the original transaction lists the replacement in
mempoolconflicts.Unloading and reloading the receiving wallet preserves the doubled total. Once the replacement confirms, the original becomes Conflicted and the displayed total corrects itself. A saved payment request is not required.
Other reproduced cases in the same classification logic
Expected behavior and responsibility
Activity should distinguish currently pending payments from replaced, expired, or not-yet-synchronized transaction history. An incoming replacement must contribute only one payment to the pending total, and historical replacement markers must not override the transaction’s current state.
Core’s balances and mempool/conflict information were correct in these reproductions. The defect is in QML’s Activity classification and aggregation. The model needs the relevant current state from Core’s wallet interface rather than relying only on confirmation depth and saved replacement markers.
Reproduced on
qt6atd567e3eb2497, macOS arm64, Qt 6.9.0, using disposable regtest wallets. The replacement and reorg cases were also reproduced on PR #990 at0d9d14ce7061; CSV exports on that tested PR revision reflected the same incorrect classification. No incorrect spend or fund loss was demonstrated.The historical replacement-marker problem here also affects a saved Receive request's received amount. In a self-payment followed by a fee bump and reorg, I reproduced 0 sats received while the original 1,000,000-sat paying transaction was the only active version in Core's mempool. The card simultaneously showed Payment received.
To reproduce in regtest:
replaced_by_txidmarker.A separate request paid by an unrelated transaction in the same disconnected block correctly retained its 1,000,000-sat tally. Repeating the replacement/reorg sequence with the affected request paid by another wallet also passed: the receiver did not have the sender's replacement marker. The demonstrated failure is the self-payment case.
Core provides current mempool membership and historical replacement metadata separately. QML's Receive scan excludes a depth-zero transaction when either it is absent from the mempool or it has a replacement marker. Here the original is in the mempool; the old marker alone removes it from the received total.
The fix for this issue should cover saved Receive totals as well as Activity classification, counting the currently active payment rather than treating a historical replacement marker as proof that it is inactive.
Reproduced on
qt6at6e54a48ab571, macOS / Qt 6.9, using the full offscreen app and isolated regtest wallets. The same Receive predicate remains in current mergedeed1f426fcb6; that later revision was checked in source, not rerun for this case.