aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorAlex Morcos <[email protected]>2017-06-29 11:29:34 -0400
committerAlex Morcos <[email protected]>2017-07-14 23:41:37 -0400
commit2fffaa97381f741786fff2e6ff25f4b9a74037fe (patch)
treef6163fb7a56b3f73bc8858ad1c336db9efb77aac /src/wallet
parentUse CoinControl to pass custom fee setting from QT. (diff)
downloaddiscoin-2fffaa97381f741786fff2e6ff25f4b9a74037fe.tar.xz
discoin-2fffaa97381f741786fff2e6ff25f4b9a74037fe.zip
Make QT fee displays use GetMinimumFee instead of estimateSmartFee
Remove helper function (CalculateEstimateType) for determining whether estimates should be conservative or not, now that this is only called once from GetMinimumFee and incorporate the logic directly there.
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/coincontrol.h4
-rw-r--r--src/wallet/wallet.cpp17
-rw-r--r--src/wallet/wallet.h2
3 files changed, 6 insertions, 17 deletions
diff --git a/src/wallet/coincontrol.h b/src/wallet/coincontrol.h
index 40c8b764b..fc0e7c519 100644
--- a/src/wallet/coincontrol.h
+++ b/src/wallet/coincontrol.h
@@ -43,9 +43,9 @@ public:
fAllowOtherInputs = false;
fAllowWatchOnly = false;
setSelected.clear();
- m_feerate = boost::none;
+ m_feerate.reset();
fOverrideFeeRate = false;
- m_confirm_target = boost::none;
+ m_confirm_target.reset();
signalRbf = fWalletRbf;
m_fee_mode = FeeEstimateMode::UNSET;
}
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index f010ff0ca..f7f296bd5 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2945,8 +2945,11 @@ CAmount CWallet::GetMinimumFee(unsigned int nTxBytes, const CCoinControl& coin_c
else { // 2. or 4.
// We will use smart fee estimation
unsigned int target = coin_control.m_confirm_target ? *coin_control.m_confirm_target : ::nTxConfirmTarget;
+ // By default estimates are economical iff we are signaling opt-in-RBF
+ bool conservative_estimate = !coin_control.signalRbf;
// Allow to override the default fee estimate mode over the CoinControl instance
- bool conservative_estimate = CalculateEstimateType(coin_control.m_fee_mode, coin_control.signalRbf);
+ if (coin_control.m_fee_mode == FeeEstimateMode::CONSERVATIVE) conservative_estimate = true;
+ else if (coin_control.m_fee_mode == FeeEstimateMode::ECONOMICAL) conservative_estimate = false;
fee_needed = estimator.estimateSmartFee(target, feeCalc, pool, conservative_estimate).GetFee(nTxBytes);
if (fee_needed == 0) {
@@ -4194,15 +4197,3 @@ bool CMerkleTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState&
{
return ::AcceptToMemoryPool(mempool, state, tx, true, NULL, NULL, false, nAbsurdFee);
}
-
-bool CalculateEstimateType(FeeEstimateMode mode, bool opt_in_rbf) {
- switch (mode) {
- case FeeEstimateMode::UNSET:
- return !opt_in_rbf; // Allow for lower fees if RBF is an option
- case FeeEstimateMode::CONSERVATIVE:
- return true;
- case FeeEstimateMode::ECONOMICAL:
- return false;
- }
- return true;
-}
diff --git a/src/wallet/wallet.h b/src/wallet/wallet.h
index 3c866776f..bb9d146a2 100644
--- a/src/wallet/wallet.h
+++ b/src/wallet/wallet.h
@@ -1213,6 +1213,4 @@ bool CWallet::DummySignTx(CMutableTransaction &txNew, const ContainerType &coins
return true;
}
-bool CalculateEstimateType(FeeEstimateMode mode, bool opt_in_rbf);
-
#endif // BITCOIN_WALLET_WALLET_H