Commit 78322df
Merge #17568: wallet: fix when sufficient preset inputs and subtractFeeFromOutputs
Summary:
eadd1304c81e0b89178e4cc7630bd31650850c85 tests: Add a test for funding with sufficient preset inputs and subtractFeeFromOutputs (Andrew Chow)
ff330badd45067cb520b1cfa1844f60a4c9f2031 Default to bnb_used = false as there are many cases where BnB is not used (Andrew Chow)
Pull request description:
#17290 introduced a bug where, when we had preset inputs that covered the amount being sent and subtractFeeFrromOutputs was being used, transaction funding would result in a `Fee exceeds maximum configured by -maxtxfee` error. This was happening because we weren't setting `bnb_used = false` when the preset inputs were used as it should have been. This resulted in a too high fee because the change would go to fees accidentally.
Apparently this particular case doesn't have a test, so I've added one as well.
Backport of Core [[bitcoin/bitcoin#17568 | PR17568]]
Depends on D7688
Test Plan:
```
ninja check
test_runner.py rpc_fundrawtransaction
```
Reviewers: #bitcoin_abc, majcosta
Reviewed By: #bitcoin_abc, majcosta
Differential Revision: https://reviews.bitcoinabc.org/D76911 parent d54de83 commit 78322df
File tree
2 files changed
+20
-7
lines changed- src/wallet
- test/functional
2 files changed
+20
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2535 | 2535 | | |
2536 | 2536 | | |
2537 | 2537 | | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
2538 | 2541 | | |
2539 | 2542 | | |
2540 | 2543 | | |
2541 | | - | |
2542 | | - | |
2543 | | - | |
2544 | 2544 | | |
2545 | 2545 | | |
2546 | 2546 | | |
| |||
2567 | 2567 | | |
2568 | 2568 | | |
2569 | 2569 | | |
2570 | | - | |
2571 | 2570 | | |
2572 | 2571 | | |
2573 | 2572 | | |
2574 | 2573 | | |
2575 | 2574 | | |
2576 | 2575 | | |
2577 | 2576 | | |
2578 | | - | |
2579 | 2577 | | |
2580 | 2578 | | |
2581 | 2579 | | |
| |||
2589 | 2587 | | |
2590 | 2588 | | |
2591 | 2589 | | |
2592 | | - | |
2593 | 2590 | | |
2594 | 2591 | | |
2595 | 2592 | | |
| |||
3018 | 3015 | | |
3019 | 3016 | | |
3020 | 3017 | | |
3021 | | - | |
| 3018 | + | |
3022 | 3019 | | |
3023 | 3020 | | |
3024 | 3021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| |||
848 | 849 | | |
849 | 850 | | |
850 | 851 | | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
851 | 867 | | |
852 | 868 | | |
853 | 869 | | |
0 commit comments