test: Replace stale TODO with mempoolminfee test in wallet_send.py #36705

Open
Conradgabe wants to merge 1 commit from test-send-fee-below-mempoolminfee into master AGit
Conradgabe commented 2026-10-30 13:04:26 +00:00 (Migrated from github.com)

wallet_send.py had a commented-out TODO from the original send PR (#16378) about returning the hex when the fee rate is below the mempool minimum. The commented code was stale; estimate_mode="sat/b" no longer exists.

Also, an explicit fee_rate is only checked against max(-mintxfee, -minrelaytxfee), not against mempoolminfee (see src/wallet/fees.cpp), so when the mempool is full, send can build a tx the node won't accept.

This PR adds a subtest covering this cases and removes the stale TODO.

With add_to_wallet=false, the returned hex is rejected by testmempoolaccept, and with add_to_wallet=true, send reports success, but the tx stays only in the wallet, not the mempool.

`wallet_send.py` had a commented-out TODO from the original `send` PR (#16378) about returning the hex when the fee rate is below the mempool minimum. The commented code was stale; `estimate_mode="sat/b"` no longer exists. Also, an explicit `fee_rate` is only checked against `max(-mintxfee, -minrelaytxfee)`, not against `mempoolminfee` (see `src/wallet/fees.cpp`), so when the mempool is full, `send` can build a tx the node won't accept. This PR adds a subtest covering this cases and removes the stale TODO. With `add_to_wallet=false`, the returned hex is rejected by `testmempoolaccept`, and with `add_to_wallet=true`, `send` reports success, but the tx stays only in the wallet, not the mempool.
DrahtBot commented 2026-10-30 13:04:36 +00:00 (Migrated from github.com)

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

External sites

Reviews

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

Type Reviewers
ACK alwaysprince05

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

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #36990 (test: replace hard-coded RPC error codes by l0rinc)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

<!--e57a25ab6845829454e8d69fc972939a--> The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. <!--006a51241073e994b41acfe9ec718e94--> ### External sites * Code coverage & benchmarks: https://corecheck.dev/bitcoin/bitcoin/pulls/36705 * Ralph review <img src=https://review.fish.foo/assets/bitcoin/bitcoin/36705.png alt="Ralph review status"> https://git.fish.foo/bitcoin/bitcoin/pulls/36705#author-ralph <!--021abf342d371248e50ceaed478a90ca--> ### Reviews See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) and [AI policy](https://github.com/bitcoin/bitcoin/blob/master/doc/AI_POLICY.md) for information on the review process. | Type | Reviewers | | ---- | --------- | | ACK | [alwaysprince05](https://github.com/bitcoin/bitcoin/pull/36705#issuecomment-6748206911) | 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. <!--174a7506f384e20aa4161008e828411d--> ### Conflicts Reviewers, this pull request conflicts with the following ones: * [#36990](https://github.com/bitcoin/bitcoin/pull/36990) <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36990.svg"></sub> (test: replace hard-coded RPC error codes by l0rinc) If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. <!--5faf32d7da4f0f540f40219e4f7537a3-->
First-time contributor

No verified findings are available from this review.

Review coverage was incomplete.


Reviewed: 871184591dd6 · Review report · Previous reports

permalink

<!-- forgejo-review-bot:bitcoin/bitcoin --> <!-- ralph-engine:current:7eebed8027c96ac27bcd79eeb7a88e35799cd96eb8fbacf34d3257986a959f64:6952af7d31ef83bb85ac4ee73e8c979307f4998f73396eb2a639b474cdfe83e6 --> <!-- ralph-base:44901d8f64cb617714707bd025ecd83f108353c2 --> <!-- ralph-head:871184591dd66bbe5182d376c35a5af2dab4e2c2 --> <!-- ralph-case:822f0d3c20c3f900c90803f012fed6ee477522896515abc9eddf671e7bc2b0ad --> No verified findings are available from this review. Review coverage was incomplete. <!-- Review tier: routine --> --- Reviewed: [`871184591dd6`](<https://git.fish.foo/bitcoin/bitcoin/commit/871184591dd66bbe5182d376c35a5af2dab4e2c2>) · [Review report](<https://review.fish.foo/report/36705-871184591dd66bbe5182d376c35a5af2dab4e2c2-2413-3.html>) · [Previous reports](<https://review.fish.foo/traces/36705/>) [permalink](<https://review.fish.foo/report/36705-871184591dd66bbe5182d376c35a5af2dab4e2c2-2413-3.html>)
fanquake commented 2026-10-30 15:20:03 +00:00 (Migrated from github.com)

cc @Sjors

cc @Sjors
DrahtBot commented 2026-10-30 17:57:02 +00:00 (Migrated from github.com)

🚧 At least one of the CI tasks failed.
Task lint: https://github.com/bitcoin/bitcoin/actions/runs/41060222545/job/124145226184
LLM reason (✨ experimental): CI failed because Python lint detected whitespace on two lines in test/functional/wallet_send.py (a whitespace-only blank line and trailing space).

Hints

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.

<!--85328a0da195eb286784d51f73fa0af9--> 🚧 At least one of the CI tasks failed. <sub>Task `lint`: https://github.com/bitcoin/bitcoin/actions/runs/41060222545/job/124145226184</sub> <sub>LLM reason (✨ experimental): CI failed because Python lint detected whitespace on two lines in `test/functional/wallet_send.py` (a whitespace-only blank line and trailing space).</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>
alwaysprince05 commented 2026-11-09 11:16:41 +00:00 (Migrated from github.com)
  • Tested on macOS, Apple Silicon.
  • wallet_send.py passes on the original PR.
  • I added a mutation in src/wallet/fees.cpp: explicit fee_rate path checks mempoolMinFee().
  • The new test fails at send with the reported 0.200 vs 0.677 sat/vB error.
  • Cwallet::CommitTransaction should be CWallet::CommitTransaction.

tACK a2d32135f3

* Tested on macOS, Apple Silicon. * wallet_send.py passes on the original PR. * I added a mutation in src/wallet/fees.cpp: explicit fee_rate path checks mempoolMinFee(). * The new test fails at send with the reported 0.200 vs 0.677 sat/vB error. * Cwallet::CommitTransaction should be CWallet::CommitTransaction. tACK a2d32135f3
Conradgabe commented 2026-11-09 15:44:55 +00:00 (Migrated from github.com)

Cwallet::CommitTransaction should be CWallet::CommitTransaction.

made the edit, thanks

> Cwallet::CommitTransaction should be CWallet::CommitTransaction. made the edit, thanks
alwaysprince05 commented 2026-11-09 18:35:27 +00:00 (Migrated from github.com)

reACK 8711845

reACK 8711845
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
bitcoin/bitcoin!36705
No description provided.