Repository navigation
Description
Summary
A wallet transaction that spends owned inputs and sends every output to an
internal destination classified as change is omitted from the GUI transaction
history. The transaction and its fee are accounted for correctly in the wallet
balance and UTXO set, but no history row is created, so the visible transaction
ledger cannot be reconciled with the balance.
Observed in qbit v1.0.0. The same relevant code path is present on the current
default branch.
Reproduction
- Create a wallet transaction spending
1.000 QBTfrom wallet-owned inputs. - Send
0.999 QBTto a wallet-owned internal destination classified as
change, paying a0.001 QBTfee. - Broadcast and confirm the transaction.
- Inspect the wallet balance, GUI transaction history,
gettransaction, and
the default wallet history RPC output.
Actual behavior
- The resulting UTXO and wallet balance correctly reflect
0.999 QBT. gettransactionrecognizes the transaction and reports its fee, but its
detailsarray is empty.- Default wallet history RPC output contains no entry for the transaction.
- The GUI transaction list contains no row, including no indication that a fee
was paid. listsinceblockwithinclude_change=truedoes expose the corresponding
send and receive entries, confirming that the underlying wallet data is
available.
Expected behavior
The transaction history should contain a payment-to-self/internal-transfer
entry showing the net fee debit. A fee-bearing wallet transaction should not
disappear solely because every output is classified as change.
Technical details
In src/qt/transactionrecord.cpp,
TransactionRecord::decomposeTransaction() computes the transaction fee, then
skips outputs marked as change. If every output is change, no
TransactionRecord is appended and the computed fee is never attached to a
GUI history entry.
The wallet RPC path has analogous behavior. CachedTxGetAmounts() in
src/wallet/receive.cpp skips change outputs when include_change is false.
gettransaction builds details through ListTransactions() without
enabling change, while wallet history RPCs exclude change by default. A
change-only transaction therefore produces no default history entries even
though its fee and balance effects are recorded.
Suggested fix
Emit a payment-to-self or fee-only record when all wallet-owned outputs were
skipped as change and the transaction has a wallet debit. The record should
show the fee without double-counting the change output.
Suggested tests
- Qt transaction decomposition test for an all-owned, change-only transaction
with a nonzero fee. - RPC test confirming
gettransaction.detailsexposes the transaction's
wallet effect. - History RPC test covering default and
include_change=truebehavior. - Regression assertion that balance and history reconcile without
double-counting change. - Coverage for both spendable and watch-only wallets.
Activity