Skip to content

Commit

Permalink
wallet: remove unneeded WALLET_BTC_KB_TO_SAT_B constant
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatack committed Nov 11, 2020
1 parent 6112cf2 commit e21212f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ using interfaces::FoundBlock;
static const std::string WALLET_ENDPOINT_BASE = "/wallet/";
static const std::string HELP_REQUIRING_PASSPHRASE{"\nRequires wallet passphrase to be set with walletpassphrase call if wallet is encrypted.\n"};

static const uint32_t WALLET_BTC_KB_TO_SAT_B = COIN / 1000; // 1 sat / B = 0.00001 BTC / kB

static inline bool GetAvoidReuseFlag(const CWallet* const pwallet, const UniValue& param) {
bool can_avoid_reuse = pwallet->IsWalletFlagSet(WALLET_FLAG_AVOID_REUSE);
bool avoid_reuse = param.isNull() ? can_avoid_reuse : param.get_bool();
Expand Down Expand Up @@ -217,12 +215,8 @@ static void SetFeeEstimateMode(const CWallet* pwallet, CCoinControl& cc, const U
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Selected estimate_mode %s requires a fee rate to be specified in conf_target", estimate_mode.get_str()));
}

CAmount fee_rate = AmountFromValue(estimate_param);
if (cc.m_fee_mode == FeeEstimateMode::SAT_B) {
fee_rate /= WALLET_BTC_KB_TO_SAT_B;
}

cc.m_feerate = CFeeRate(fee_rate);
CAmount feerate{AmountFromValue(estimate_param)};
cc.m_feerate = cc.m_fee_mode == FeeEstimateMode::SAT_B ? CFeeRate(feerate, COIN) : CFeeRate(feerate);

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

0 comments on commit e21212f

Please sign in to comment.