Drop rbf-related parts

This commit is contained in:
UdjinM6 2019-08-09 02:08:41 +03:00 committed by Pasta
parent 00c4046e55
commit 00052aa15b
No known key found for this signature in database
GPG Key ID: D362C9F7142766AE
6 changed files with 6 additions and 17 deletions

View File

@ -537,7 +537,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog)
else nBytesInputs += 148; else nBytesInputs += 148;
} }
bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET, coinControl->signalRbf); bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET);
// calculation // calculation
if (nQuantity > 0) if (nQuantity > 0)

View File

@ -223,8 +223,6 @@ void SendCoinsDialog::setModel(WalletModel *_model)
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateGlobalFeeVariables()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels())); connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
ui->customFee->setSingleStep(CWallet::GetRequiredFee(1000)); ui->customFee->setSingleStep(CWallet::GetRequiredFee(1000));
updateFeeSectionControls(); updateFeeSectionControls();
updateMinFeeLabel(); updateMinFeeLabel();
@ -766,7 +764,7 @@ void SendCoinsDialog::updateSmartFeeLabel()
int nBlocksToConfirm = getConfTargetForIndex(ui->confTargetSelector->currentIndex()); int nBlocksToConfirm = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
FeeCalculation feeCalc; FeeCalculation feeCalc;
bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET, ui->optInRBF->isChecked()); bool conservative_estimate = CalculateEstimateType(FeeEstimateMode::UNSET);
CFeeRate feeRate = ::feeEstimator.estimateSmartFee(nBlocksToConfirm, &feeCalc, ::mempool, conservative_estimate); CFeeRate feeRate = ::feeEstimator.estimateSmartFee(nBlocksToConfirm, &feeCalc, ::mempool, conservative_estimate);
if (feeRate <= CFeeRate(0)) // not enough data => minfee if (feeRate <= CFeeRate(0)) // not enough data => minfee
{ {
@ -939,7 +937,6 @@ void SendCoinsDialog::coinControlUpdateLabels()
} else { } else {
CoinControlDialog::coinControl->nConfirmTarget = model->getDefaultConfirmTarget(); CoinControlDialog::coinControl->nConfirmTarget = model->getDefaultConfirmTarget();
} }
CoinControlDialog::coinControl->signalRbf = ui->optInRBF->isChecked();
for(int i = 0; i < ui->entries->count(); ++i) for(int i = 0; i < ui->entries->count(); ++i)
{ {

View File

@ -18,7 +18,6 @@
#include "keystore.h" #include "keystore.h"
#include "validation.h" #include "validation.h"
#include "net.h" // for g_connman #include "net.h" // for g_connman
#include "policy/fees.h"
#include "sync.h" #include "sync.h"
#include "ui_interface.h" #include "ui_interface.h"
#include "util.h" // for GetBoolArg #include "util.h" // for GetBoolArg

View File

@ -476,9 +476,6 @@ UniValue sendtoaddress(const JSONRPCRequest& request)
} }
CCoinControl coin_control; CCoinControl coin_control;
if (request.params.size() > 5 && !request.params[5].isNull()) {
coin_control.signalRbf = request.params[5].get_bool();
}
if (request.params.size() > 6 && !request.params[6].isNull()) { if (request.params.size() > 6 && !request.params[6].isNull()) {
coin_control.nConfirmTarget = request.params[6].get_int(); coin_control.nConfirmTarget = request.params[6].get_int();
@ -1050,9 +1047,6 @@ UniValue sendmany(const JSONRPCRequest& request)
subtractFeeFrom = request.params[5].get_array(); subtractFeeFrom = request.params[5].get_array();
CCoinControl coin_control; CCoinControl coin_control;
if (request.params.size() > 5 && !request.params[5].isNull()) {
coin_control.signalRbf = request.params[5].get_bool();
}
if (request.params.size() > 6 && !request.params[6].isNull()) { if (request.params.size() > 6 && !request.params[6].isNull()) {
coin_control.nConfirmTarget = request.params[6].get_int(); coin_control.nConfirmTarget = request.params[6].get_int();
@ -3193,7 +3187,7 @@ static const CRPCCommand commands[] =
{ "wallet", "lockunspent", &lockunspent, true, {"unlock","transactions"} }, { "wallet", "lockunspent", &lockunspent, true, {"unlock","transactions"} },
{ "wallet", "move", &movecmd, false, {"fromaccount","toaccount","amount","minconf","comment"} }, { "wallet", "move", &movecmd, false, {"fromaccount","toaccount","amount","minconf","comment"} },
{ "wallet", "sendfrom", &sendfrom, false, {"fromaccount","toaddress","amount","minconf","addlocked","comment","comment_to"} }, { "wallet", "sendfrom", &sendfrom, false, {"fromaccount","toaddress","amount","minconf","addlocked","comment","comment_to"} },
{ "wallet", "sendmany", &sendmany, false, {"fromaccount","amounts","minconf","addlocked","comment","subtractfeefrom","replaceable","conf_target","estimate_mode"} }, { "wallet", "sendmany", &sendmany, false, {"fromaccount","amounts","minconf","addlocked","comment","subtractfeefrom","conf_target","estimate_mode"} },
{ "wallet", "sendtoaddress", &sendtoaddress, false, {"address","amount","comment","comment_to","subtractfeefromamount","conf_target","estimate_mode"} }, { "wallet", "sendtoaddress", &sendtoaddress, false, {"address","amount","comment","comment_to","subtractfeefromamount","conf_target","estimate_mode"} },
{ "wallet", "setaccount", &setaccount, true, {"address","account"} }, { "wallet", "setaccount", &setaccount, true, {"address","account"} },
{ "wallet", "settxfee", &settxfee, true, {"amount"} }, { "wallet", "settxfee", &settxfee, true, {"amount"} },

View File

@ -3779,7 +3779,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
currentConfirmationTarget = coinControl->nConfirmTarget; currentConfirmationTarget = coinControl->nConfirmTarget;
// Allow to override the default fee estimate mode over the CoinControl instance // Allow to override the default fee estimate mode over the CoinControl instance
bool conservative_estimate = CalculateEstimateType(coinControl ? coinControl->m_fee_mode : FeeEstimateMode::UNSET, rbf); bool conservative_estimate = CalculateEstimateType(coinControl ? coinControl->m_fee_mode : FeeEstimateMode::UNSET);
CAmount nFeeNeeded = GetMinimumFee(nBytes, currentConfirmationTarget, ::mempool, ::feeEstimator, &feeCalc, false /* ignoreGlobalPayTxFee */, conservative_estimate); CAmount nFeeNeeded = GetMinimumFee(nBytes, currentConfirmationTarget, ::mempool, ::feeEstimator, &feeCalc, false /* ignoreGlobalPayTxFee */, conservative_estimate);
if (coinControl && coinControl->fOverrideFeeRate) if (coinControl && coinControl->fOverrideFeeRate)
@ -5563,10 +5563,9 @@ bool CMerkleTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState&
return ::AcceptToMemoryPool(mempool, state, tx, true, nullptr, false, nAbsurdFee); return ::AcceptToMemoryPool(mempool, state, tx, true, nullptr, false, nAbsurdFee);
} }
bool CalculateEstimateType(FeeEstimateMode mode, bool opt_in_rbf) { bool CalculateEstimateType(FeeEstimateMode mode) {
switch (mode) { switch (mode) {
case FeeEstimateMode::UNSET: case FeeEstimateMode::UNSET:
return !opt_in_rbf; // Allow for lower fees if RBF is an option
case FeeEstimateMode::CONSERVATIVE: case FeeEstimateMode::CONSERVATIVE:
return true; return true;
case FeeEstimateMode::ECONOMICAL: case FeeEstimateMode::ECONOMICAL:

View File

@ -1309,6 +1309,6 @@ public:
} }
}; };
bool CalculateEstimateType(FeeEstimateMode mode, bool opt_in_rbf); bool CalculateEstimateType(FeeEstimateMode mode);
#endif // BITCOIN_WALLET_WALLET_H #endif // BITCOIN_WALLET_WALLET_H