wallet, rpc: Add listrawtransactions RPC #35813

pull pablomartin4btc wants to merge 2 commits into bitcoin:master from pablomartin4btc:wallet/listrawtransactions changing 6 files +274 −0
  1. pablomartin4btc commented at 5:08 PM on July 26, 2026: member

    Add a new listrawtransactions RPC that returns wallet transactions without logical interpretation. Unlike listtransactions, which only lists transactions with an economic category (sends to external addresses, receives from outside), this RPC returns every transaction the wallet knows about — including consolidations and self-transfers that would otherwise be invisible.

    Each transaction appears exactly once with its net wallet balance change (amount) and, when the wallet funded the transaction, the fee paid (fee). Pagination is supported via count and skip parameters, matching the interface of listtransactions.

    Next possible follow-ups:

    • A filter parameter ("all" / "received" / "sent" / "self") once per-tx semantics are agreed on
    • Some fields inherited from TransactionDescriptionString() carry references to category (e.g. replaced_by_txid, parent_descs) which don't apply here — could be cleaned up in a separate pass

    Closes #34632.

    Previous attempt: #35009 (by alfonsoromanz), closed in favour of a separate RPC as suggested by achow101.

  2. DrahtBot added the label Wallet on Jul 26, 2026
  3. DrahtBot commented at 5:08 PM on July 26, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--006a51241073e994b41acfe9ec718e94-->

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/35813.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline and AI policy for information on the review process.

    Type Reviewers
    Concept ACK w0xlt

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • assert_raises_rpc_error(-8, "Negative count", self.nodes[0].listrawtransactions, -1) in test/functional/wallet_listrawtransactions.py
    • assert_raises_rpc_error(-8, "Negative from", self.nodes[0].listrawtransactions, 10, -1) in test/functional/wallet_listrawtransactions.py

    Possible places where comparison-specific test macros should replace generic comparisons:

    • [test/functional/wallet_listrawtransactions.py] assert entry["amount"] > 0 -> use assert_greater_than(entry["amount"], 0) for a clearer comparison-specific failure.
    • [test/functional/wallet_listrawtransactions.py] assert total >= 3, f"Need at least 3 txs for pagination test, got {total}" -> use assert_greater_than_or_equal(total, 3) instead.

    <sup>2026-07-28 00:39:36</sup>

  4. pablomartin4btc referenced this in commit 2ca8449550 on Jul 26, 2026
  5. DrahtBot added the label CI failed on Jul 26, 2026
  6. DrahtBot commented at 5:12 PM on July 26, 2026: contributor

    <!--85328a0da195eb286784d51f73fa0af9-->

    🚧 At least one of the CI tasks failed. <sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/30211957111/job/89819583780</sub> <sub>LLM reason (✨ experimental): CI failed because the lint test lint-files.py reported an executable-permission mismatch: test/functional/wallet_listrawtransactions.py has shebang but mode 644 instead of required 755.</sub>

    <details><summary>Hints</summary>

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

    </details>

  7. pablomartin4btc referenced this in commit 1555198853 on Jul 26, 2026
  8. pablomartin4btc force-pushed on Jul 26, 2026
  9. pablomartin4btc referenced this in commit f592d25fc7 on Jul 26, 2026
  10. pablomartin4btc force-pushed on Jul 26, 2026
  11. DrahtBot removed the label CI failed on Jul 26, 2026
  12. pablomartin4btc renamed this:
    wallet: Add listrawtransactions RPC
    wallet, rpc: Add listrawtransactions RPC
    on Jul 26, 2026
  13. pablomartin4btc commented at 11:38 PM on July 26, 2026: member

    -<ins>Updates</ins>:

    • Added release notes.
  14. w0xlt commented at 9:21 AM on July 27, 2026: contributor

    Concept ACK.

  15. in src/wallet/rpc/transactions.cpp:391 in f592d25fc7 outdated
     386 | + * @param  wtx            The wallet transaction.
     387 | + * @return                A JSON object with the net wallet balance change and
     388 | + *                        transaction metadata, without logical interpretation
     389 | + *                        (no category assignment, no change suppression).
     390 | + */
     391 | +static UniValue ListRawTransaction(const CWallet& wallet, const CWalletTx& wtx)
    


    vicjuma commented at 10:08 PM on July 27, 2026:

    without logical interpretation

    tACK. I think coinbase tx category may apply here.


    pablomartin4btc commented at 12:34 AM on July 28, 2026:

    A coinbase tx will be flagged via the "generated" field, not "category". Added a test for this in the first commit.

  16. pablomartin4btc force-pushed on Jul 28, 2026
  17. wallet, test: Add listrawtransactions RPC
    Add a new `listrawtransactions` RPC that returns wallet transactions
    without logical interpretation. Unlike `listtransactions`, which only
    lists transactions with an economic category (sends to external
    addresses, receives from outside), this RPC returns every transaction
    the wallet knows about — including consolidations and self-transfers
    that would otherwise be invisible.
    
    Each transaction appears exactly once with its net wallet balance
    change (`amount`) and, when the wallet funded the transaction, the fee
    paid (`fee`). Pagination is supported via `count` and `skip` parameters,
    matching the interface of `listtransactions`.
    ad67c8a67a
  18. doc: add release notes for listrawtransactions 142e1ac0f7
  19. pablomartin4btc force-pushed on Jul 28, 2026
  20. DrahtBot added the label CI failed on Jul 28, 2026
  21. pablomartin4btc commented at 12:43 AM on July 28, 2026: member

    -<ins>Updates</ins>:

    • Added a test for a coinbase tx.
  22. DrahtBot removed the label CI failed on Jul 28, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-07-31 20:50 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me