Skip to content

Commit 93decbc

Browse files
committed
Merge #19370: Static asserts for consistency of fee defaults
1554b54 Static asserts for consistency of fee defaults. (Daniel Kraft) Pull request description: This adds `static_assert`'s that ensure that the default values given for fee levels in the wallet (minimum fee and incremental feerate increase) are at least as high as the corresponding levels configured in the core node policy. Since the core policy values are enforced by the network, it makes sense for the wallet to be conservative and above (or at least not below) this. ACKs for top commit: laanwj: code review ACK 1554b54, these assumptions seem straightforward Tree-SHA512: 50e5adf082f467062334377f82a3ee75bcfd436afc65bd0eb33c8d0549d6d90fd1f48c31f60cabe523eb59be9efa8ae0879e9e09cd51ca9c1bd466631ce03cf4
2 parents c7b4968 + 1554b54 commit 93decbc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/test/wallet_tests.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ extern UniValue importmulti(const JSONRPCRequest& request);
2828
extern UniValue dumpwallet(const JSONRPCRequest& request);
2929
extern UniValue importwallet(const JSONRPCRequest& request);
3030

31+
// Ensure that fee levels defined in the wallet are at least as high
32+
// as the default levels for node policy.
33+
static_assert(DEFAULT_TRANSACTION_MINFEE >= DEFAULT_MIN_RELAY_TX_FEE, "wallet minimum fee is smaller than default relay fee");
34+
static_assert(WALLET_INCREMENTAL_RELAY_FEE >= DEFAULT_INCREMENTAL_RELAY_FEE, "wallet incremental fee is smaller than default incremental relay fee");
35+
3136
BOOST_FIXTURE_TEST_SUITE(wallet_tests, WalletTestingSetup)
3237

3338
static std::shared_ptr<CWallet> TestLoadWallet(interfaces::Chain& chain)

0 commit comments

Comments
 (0)