test: add test for rebroadcast of transaction received via p2p #34359

pull mzumsande wants to merge 2 commits into bitcoin:master from mzumsande:202601_test_rebroadcast changing 3 files +80 −3
  1. mzumsande commented at 2:42 am on January 21, 2026: contributor

    The wallet doesn’t only rebroadcast transactions it created, but also relevant transactions received via p2p. Since this is not self-evident, add test coverage for it.

    Will keep this in draft for now, because the added test fails intermittently on master. After debugging this I think it is due to a wallet bug, which is fixed in the separate PR #34358. I rebased this PR on #34358.

  2. DrahtBot added the label Tests on Jan 21, 2026
  3. DrahtBot commented at 2:42 am on January 21, 2026: contributor

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

    Code Coverage & Benchmarks

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

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • resubmit 1 unconfirmed transactions -> resubmit 1 unconfirmed transaction [plural “transactions” disagrees with the numeral “1”, making the log message grammatically incorrect]

    2026-01-26 03:18:28

  4. mzumsande force-pushed on Jan 21, 2026
  5. DrahtBot added the label CI failed on Jan 21, 2026
  6. vasild commented at 11:30 am on January 22, 2026: contributor

    2026-01-21T03:34:27.4304152Z  test 2026-01-21T03:34:27.140268Z TestFramework (INFO): node0 sends a tx to node1 and disconnects  … 2026-01-21T03:34:27.4319719Z  node0 2026-01-21T03:34:27.149584Z (mocktime: 2026-02-07T03:50:31Z) [httpworker.1] [wallet/wallet.h:938] [WalletLogPrintf] [default_wallet] Submitting wtx c255f5b61919a60877d4e91eb81f656f85e743513119f5ddcc9cffc4ffb62b45 to mempool and for broadcast to peers  … 2026-01-21T03:34:27.4320508Z  node0 2026-01-21T03:34:27.149947Z (mocktime: 2026-02-07T03:50:31Z) [httpworker.1] [wallet/wallet.h:938] [WalletLogPrintf] [default_wallet] CommitTransaction(): Transaction cannot be broadcast immediately, bad-txns-inputs-missingorspent 

    So, node0 did not like the transaction it generated and failed to broadcast it to node1: bad-txns-inputs-missingorspent. Happens only sometimes.

  7. mzumsande commented at 12:03 pm on January 22, 2026: contributor
    yes - because of the wallet bug, the wallet creates an invalid transaction, trying to double-spend an utxo that was already used in a block. The node then rejects that tx obviously, and the rpc querying for the tx fails. I’ll rebase on #34358 with the next push. [Edit:done now]
  8. wallet: fix removeprunedfunds bug with conflicting transactions
    removeprunedfunds removes all entries from mapTxSpends for the
    inputs of the pruned tx. However, this is incorrect, because there could be
    multiple entries from conflicting transactions (that shouldn't be
    removed as well). This could lead to the wallet creating invalid
    transactions, trying to double spend utxos.
    The bug persists when the conflicting tx was mined, because
    the wallet trusts its internal accounting instead of calling
    AddToSpends again.
    30237622b9
  9. test: add test for rebroadcast of transaction received via p2p
    The wallet doesn't only rebroadcast transactions it created, but
    also relevant transactions received via p2p. Since this is not
    self-evident, add test coverage for it.
    ce8560d6c8
  10. mzumsande force-pushed on Jan 26, 2026
  11. DrahtBot removed the label CI failed on Jan 26, 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-01-27 06:13 UTC

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