Skip to content

Commit e21212f

Browse files
committed
wallet: remove unneeded WALLET_BTC_KB_TO_SAT_B constant
1 parent 6112cf2 commit e21212f

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ using interfaces::FoundBlock;
4747
static const std::string WALLET_ENDPOINT_BASE = "/wallet/";
4848
static const std::string HELP_REQUIRING_PASSPHRASE{"\nRequires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.\n"};
4949

50-
static const uint32_t WALLET_BTC_KB_TO_SAT_B = COIN / 1000; // 1 sat / B = 0.00001 BTC / kB
51-
5250
static inline bool GetAvoidReuseFlag(const CWallet* const pwallet, const UniValue& param) {
5351
bool can_avoid_reuse = pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE);
5452
bool avoid_reuse = param.isNull() ? can_avoid_reuse : param.get_bool();
@@ -217,12 +215,8 @@ static void SetFeeEstimateMode(const CWallet* pwallet, CCoinControl& cc, const U
217215
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Selected estimate_mode %s requires a fee rate to be specified in conf_target", estimate_mode.get_str()));
218216
}
219217

220-
CAmount fee_rate = AmountFromValue(estimate_param);
221-
if (cc.m_fee_mode == FeeEstimateMode::SAT_B) {
222-
fee_rate /= WALLET_BTC_KB_TO_SAT_B;
223-
}
224-
225-
cc.m_feerate = CFeeRate(fee_rate);
218+
CAmount feerate{AmountFromValue(estimate_param)};
219+
cc.m_feerate = cc.m_fee_mode == FeeEstimateMode::SAT_B ? CFeeRate(feerate, COIN) : CFeeRate(feerate);
226220

227221
// default RBF to true for explicit fee rate modes
228222
if (cc.m_signal_bip125_rbf == nullopt) cc.m_signal_bip125_rbf = true;

0 commit comments

Comments
 (0)