bitcoin/src/wallet
Andrew Chow 8f3021155e
Merge bitcoin/bitcoin#26643: wallet: Move fee underpayment check to after all fee has been set
798430d127 wallet: Sanity check fee paid cannot be negative (Andrew Chow)
c1a84f108e wallet: Move fee underpayment check to after fee setting (Andrew Chow)
e5daf976d5 wallet: Rename nFeeRet in CreateTransactionInternal to current_fee (Andrew Chow)

Pull request description:

  Currently the fee underpayment check occurs right after we calculate what the transaction's fee should be. However the fee paid by the transaction at that time does not always match. Notably, when doing SFFO, the fee paid at that time will almost always be less than the fee required, which then required having a bypass of the underpayment check that results in SFFO payments going through when they should not.

  This PR moves the underpayment check to after fees have been finalized so that we always check whether the fee is being underpaid. This removes the exception for SFFO and unifies this behavior for both SFFO and non-SFFO txs.

ACKs for top commit:
  S3RK:
    Code review ACK 798430d127
  furszy:
    Code review ACK 798430d
  glozow:
    utACK 798430d127, code looks correct to me

Tree-SHA512: 720e8a3dbdc9937b12ee7881eb2ad58332c9584520da87ef3080e6f9d6220ce8d3bd8b9317b4877e56a229113437340852976db8f64df0d5cc50723fa04b02f0
2022-12-13 14:19:00 -05:00
..
rpc Merge bitcoin/bitcoin#26213: rpc: Strict type checking for RPC boolean parameters 2022-12-10 09:58:33 +00:00
test Merge bitcoin/bitcoin#25729: wallet: Check max transaction weight in CoinSelection 2022-12-06 12:08:58 -05:00
bdb.cpp Merge bitcoin/bitcoin#25499: Use steady clock for all millis bench logging 2022-09-16 11:10:15 +01:00
bdb.h scripted-diff: replace non-standard fixed width integer types (u_int... -> uint`...) 2022-05-12 15:44:24 +02:00
coincontrol.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
coincontrol.h wallet: skip available coins fetch if "other inputs" are disallowed 2022-10-26 15:47:51 -03:00
coinselection.cpp wallet: Check max tx weight in coin selector 2022-12-05 19:32:11 +01:00
coinselection.h wallet: Check max tx weight in coin selector 2022-12-05 19:32:11 +01:00
context.cpp refactor: use C++11 default initializers 2022-05-17 17:18:58 +01:00
context.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
crypter.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
crypter.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
db.cpp Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
db.h Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
dump.cpp Fixup clang-tidy named argument comments 2022-12-05 15:51:46 +00:00
dump.h Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
external_signer_scriptpubkeyman.cpp GetExternalSigner(): fail if multiple signers are found 2022-06-09 20:34:46 +02:00
external_signer_scriptpubkeyman.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
feebumper.cpp Merge bitcoin/bitcoin#25775: docs: remove non-signaling mentions of BIP125 2022-08-22 10:35:26 +01:00
feebumper.h bumpfee: be able to bump fee of a tx with external inputs 2022-08-19 11:27:01 -04:00
fees.cpp Fixup clang-tidy named argument comments 2022-12-05 15:51:46 +00:00
fees.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
init.cpp scripted-diff: Avoid incompatibility with CMake AUTOUIC feature 2022-06-14 10:38:51 +02:00
interfaces.cpp Merge bitcoin/bitcoin#26298: refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a 2022-12-07 14:54:23 +00:00
ismine.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
load.cpp wallet: trigger MaybeResendWalletTxs() every minute 2022-08-25 14:29:25 +01:00
load.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
receive.cpp Merge bitcoin/bitcoin#25707: refactor: Make const references to avoid unnecessarily copying objects and enable two clang-tidy checks 2022-08-19 17:11:06 +02:00
receive.h Merge bitcoin/bitcoin#25504: RPC: allow to track coins by parent descriptors 2022-08-16 13:08:05 -04:00
salvage.cpp Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
salvage.h Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
scriptpubkeyman.cpp psbt: Include output pubkey in additional pubkeys to sign 2022-10-28 20:03:22 -04:00
scriptpubkeyman.h wallet: add method for retrieving the end range for a ScriptPubKeyMan 2022-10-25 15:57:38 +02:00
spend.cpp wallet: Sanity check fee paid cannot be negative 2022-12-09 14:52:43 -05:00
spend.h refactor: make CoinsResult total amounts members private 2022-12-02 12:39:16 -03:00
sqlite.cpp scripted-diff: Convert global Mutexes to GlobalMutexes 2022-05-21 01:23:23 +10:00
sqlite.h Replace use of ArgsManager with DatabaseOptions 2022-03-16 08:26:28 +01:00
transaction.cpp Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
transaction.h wallet: Deduplicate Resend and ReacceptWalletTransactions 2022-08-29 12:38:06 -04:00
wallet.cpp Merge bitcoin/bitcoin#26298: refactor: Move src/interfaces/*.cpp files to libbitcoin_common.a 2022-12-07 14:54:23 +00:00
wallet.h Merge bitcoin/bitcoin#26302: refactor: Use type-safe time point for CWallet::m_next_resend 2022-10-24 10:11:13 +08:00
walletdb.cpp Merge bitcoin/bitcoin#26462: wallet: fix crash on loading descriptor wallet containing legacy key type entries 2022-12-05 17:37:48 -05:00
walletdb.h wallet: throw error if legacy entries are present on loading descriptor wallets 2022-11-08 12:29:12 +01:00
wallettool.cpp Fixup clang-tidy named argument comments 2022-12-05 15:51:46 +00:00
wallettool.h Add src/wallet/* code to wallet:: namespace 2022-01-06 22:14:16 -05:00
walletutil.cpp Use ArgsManager::GetPathArg() for "-walletdir" option 2022-02-09 19:31:23 +02:00
walletutil.h Implement LegacyScriptPubKeyMan::MigrateToDescriptor 2022-08-25 16:25:53 -04:00