Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/qt/assetsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ AssetsDialog::AssetsDialog(const PlatformStyle *_platformStyle, QWidget *parent)
/** RVN START */
connect(ui->createAssetButton, SIGNAL(clicked()), this, SLOT(createAssetButtonClicked()));
connect(ui->reissueAssetButton, SIGNAL(clicked()), this, SLOT(reissueAssetButtonClicked()));
ui->optInRBF->hide();

// If the network is regtest. Add some helper buttons to the asset GUI
if (Params().NetworkIDString() != "regtest") {
Expand Down Expand Up @@ -188,15 +187,16 @@ void AssetsDialog::setModel(WalletModel *_model)
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(assetControlUpdateLabels()));
connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(assetControlUpdateLabels()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(assetControlUpdateLabels()));
ui->customFee->setSingleStep(GetRequiredFee(1000));
updateFeeSectionControls();
updateMinFeeLabel();
updateSmartFeeLabel();

// set default rbf checkbox state
ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
// ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
ui->optInRBF->hide();

// set the smartfee-sliders default value (wallets default conf.target or last stored value)
QSettings settings;
Expand Down Expand Up @@ -341,12 +341,12 @@ void AssetsDialog::on_sendButton_clicked()
questionString.append(" (" + QString::number((double)GetVirtualTransactionSize(tx) / 1000) + " kB)");
}

if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span>");
questionString.append(tr("This transaction signals replaceability (optin-RBF)."));
questionString.append("</span>");
}
// if (ui->optInRBF->isChecked())
// {
// questionString.append("<hr /><span>");
// questionString.append(tr("This transaction signals replaceability (optin-RBF)."));
// questionString.append("</span>");
// }

SendConfirmationDialog confirmationDialog(tr("Confirm send assets"),
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);
Expand Down Expand Up @@ -673,7 +673,7 @@ void AssetsDialog::updateAssetControlState(CCoinControl& ctrl)
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
ctrl.signalRbf = ui->optInRBF->isChecked();
// ctrl.signalRbf = ui->optInRBF->isChecked();
}

void AssetsDialog::updateSmartFeeLabel()
Expand Down
9 changes: 5 additions & 4 deletions src/qt/createassetdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,16 @@ void CreateAssetDialog::setModel(WalletModel *_model)
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
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()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
ui->customFee->setSingleStep(GetRequiredFee(1000));
updateFeeSectionControls();
updateMinFeeLabel();
updateSmartFeeLabel();

// set default rbf checkbox state
ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
// ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
ui->optInRBF->hide();

// set the smartfee-sliders default value (wallets default conf.target or last stored value)
QSettings settings;
Expand Down Expand Up @@ -728,7 +729,7 @@ void CreateAssetDialog::updateCoinControlState(CCoinControl& ctrl)
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
ctrl.signalRbf = ui->optInRBF->isChecked();
// ctrl.signalRbf = ui->optInRBF->isChecked();
}

void CreateAssetDialog::updateSmartFeeLabel()
Expand Down
9 changes: 5 additions & 4 deletions src/qt/reissueassetdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,16 @@ void ReissueAssetDialog::setModel(WalletModel *_model)
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
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()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
ui->customFee->setSingleStep(GetRequiredFee(1000));
updateFeeSectionControls();
updateMinFeeLabel();
updateSmartFeeLabel();

// set default rbf checkbox state
ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
// ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
ui->optInRBF->hide();

// set the smartfee-sliders default value (wallets default conf.target or last stored value)
QSettings settings;
Expand Down Expand Up @@ -716,7 +717,7 @@ void ReissueAssetDialog::updateCoinControlState(CCoinControl& ctrl)
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
ctrl.signalRbf = ui->optInRBF->isChecked();
// ctrl.signalRbf = ui->optInRBF->isChecked();
}

void ReissueAssetDialog::updateSmartFeeLabel()
Expand Down
21 changes: 11 additions & 10 deletions src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,16 @@ void SendCoinsDialog::setModel(WalletModel *_model)
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(setMinimumFee()));
connect(ui->checkBoxMinimumFee, SIGNAL(stateChanged(int)), this, SLOT(updateFeeSectionControls()));
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()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(updateSmartFeeLabel()));
// connect(ui->optInRBF, SIGNAL(stateChanged(int)), this, SLOT(coinControlUpdateLabels()));
ui->customFee->setSingleStep(GetRequiredFee(1000));
updateFeeSectionControls();
updateMinFeeLabel();
updateSmartFeeLabel();

// set default rbf checkbox state
ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
// ui->optInRBF->setCheckState(model->getDefaultWalletRbf() ? Qt::Checked : Qt::Unchecked);
ui->optInRBF->hide();

// set the smartfee-sliders default value (wallets default conf.target or last stored value)
QSettings settings;
Expand Down Expand Up @@ -324,12 +325,12 @@ void SendCoinsDialog::on_sendButton_clicked()
questionString.append(QString("<span style='font-size:10pt;font-weight:normal;'><br />(=%2)</span>")
.arg(alternativeUnits.join(" " + tr("or") + "<br />")));

if (ui->optInRBF->isChecked())
{
questionString.append("<hr /><span>");
questionString.append(tr("This transaction signals replaceability (optin-RBF)."));
questionString.append("</span>");
}
// if (ui->optInRBF->isChecked())
// {
// questionString.append("<hr /><span>");
// questionString.append(tr("This transaction signals replaceability (optin-RBF)."));
// questionString.append("</span>");
// }

SendConfirmationDialog confirmationDialog(tr("Confirm send coins"),
questionString.arg(formatted.join("<br />")), SEND_CONFIRM_DELAY, this);
Expand Down Expand Up @@ -629,7 +630,7 @@ void SendCoinsDialog::updateCoinControlState(CCoinControl& ctrl)
// Avoid using global defaults when sending money from the GUI
// Either custom fee will be used or if not selected, the confirmation target from dropdown box
ctrl.m_confirm_target = getConfTargetForIndex(ui->confTargetSelector->currentIndex());
ctrl.signalRbf = ui->optInRBF->isChecked();
// ctrl.signalRbf = ui->optInRBF->isChecked();
}

void SendCoinsDialog::updateSmartFeeLabel()
Expand Down
10 changes: 5 additions & 5 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa

// Actions
abandonAction = new QAction(tr("Abandon transaction"), this);
bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
bumpFeeAction->setObjectName("bumpFeeAction");
// bumpFeeAction = new QAction(tr("Increase transaction fee"), this);
// bumpFeeAction->setObjectName("bumpFeeAction");
QAction *copyAddressAction = new QAction(tr("Copy address"), this);
QAction *copyLabelAction = new QAction(tr("Copy label"), this);
QAction *copyAmountAction = new QAction(tr("Copy amount"), this);
Expand All @@ -188,7 +188,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
contextMenu->addAction(copyTxPlainText);
contextMenu->addAction(showDetailsAction);
contextMenu->addSeparator();
contextMenu->addAction(bumpFeeAction);
// contextMenu->addAction(bumpFeeAction);
contextMenu->addAction(abandonAction);
contextMenu->addAction(editLabelAction);

Expand All @@ -210,7 +210,7 @@ TransactionView::TransactionView(const PlatformStyle *platformStyle, QWidget *pa
connect(view, SIGNAL(doubleClicked(QModelIndex)), this, SIGNAL(doubleClicked(QModelIndex)));
connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint)));

connect(bumpFeeAction, SIGNAL(triggered()), this, SLOT(bumpFee()));
// connect(bumpFeeAction, SIGNAL(triggered()), this, SLOT(bumpFee()));
connect(abandonAction, SIGNAL(triggered()), this, SLOT(abandonTx()));
connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress()));
connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));
Expand Down Expand Up @@ -450,7 +450,7 @@ void TransactionView::contextualMenu(const QPoint &point)
uint256 hash;
hash.SetHex(selection.at(0).data(TransactionTableModel::TxHashRole).toString().toStdString());
abandonAction->setEnabled(model->transactionCanBeAbandoned(hash));
bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));
// bumpFeeAction->setEnabled(model->transactionCanBeBumped(hash));

if(index.isValid())
{
Expand Down
147 changes: 75 additions & 72 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,82 +748,85 @@ bool WalletModel::abandonTransaction(uint256 hash) const

bool WalletModel::transactionCanBeBumped(uint256 hash) const
{
LOCK2(cs_main, wallet->cs_wallet);
const CWalletTx *wtx = wallet->GetWalletTx(hash);
return wtx && SignalsOptInRBF(*wtx) && !wtx->mapValue.count("replaced_by_txid");
return false;
// For now, remove the ability to bump a transaction. Always return false.
// LOCK2(cs_main, wallet->cs_wallet);
// const CWalletTx *wtx = wallet->GetWalletTx(hash);
// return wtx && SignalsOptInRBF(*wtx) && !wtx->mapValue.count("replaced_by_txid");
}

bool WalletModel::bumpFee(uint256 hash)
{
std::unique_ptr<CFeeBumper> feeBump;
{
CCoinControl coin_control;
coin_control.signalRbf = true;
LOCK2(cs_main, wallet->cs_wallet);
feeBump.reset(new CFeeBumper(wallet, hash, coin_control, 0));
}
if (feeBump->getResult() != BumpFeeResult::OK)
{
QMessageBox::critical(0, tr("Fee bump error"), tr("Increasing transaction fee failed") + "<br />(" +
(feeBump->getErrors().size() ? QString::fromStdString(feeBump->getErrors()[0]) : "") +")");
return false;
}

// allow a user based fee verification
QString questionString = tr("Do you want to increase the fee?");
questionString.append("<br />");
CAmount oldFee = feeBump->getOldFee();
CAmount newFee = feeBump->getNewFee();
questionString.append("<table style=\"text-align: left;\">");
questionString.append("<tr><td>");
questionString.append(tr("Current fee:"));
questionString.append("</td><td>");
questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), oldFee));
questionString.append("</td></tr><tr><td>");
questionString.append(tr("Increase:"));
questionString.append("</td><td>");
questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), newFee - oldFee));
questionString.append("</td></tr><tr><td>");
questionString.append(tr("New fee:"));
questionString.append("</td><td>");
questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), newFee));
questionString.append("</td></tr></table>");
SendConfirmationDialog confirmationDialog(tr("Confirm fee bump"), questionString);
confirmationDialog.exec();
QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();

// cancel sign&broadcast if users doesn't want to bump the fee
if (retval != QMessageBox::Yes) {
return false;
}

WalletModel::UnlockContext ctx(requestUnlock());
if(!ctx.isValid())
{
return false;
}

// sign bumped transaction
bool res = false;
{
LOCK2(cs_main, wallet->cs_wallet);
res = feeBump->signTransaction(wallet);
}
if (!res) {
QMessageBox::critical(0, tr("Fee bump error"), tr("Can't sign transaction."));
return false;
}
// commit the bumped transaction
{
LOCK2(cs_main, wallet->cs_wallet);
res = feeBump->commit(wallet);
}
if(!res) {
QMessageBox::critical(0, tr("Fee bump error"), tr("Could not commit transaction") + "<br />(" +
QString::fromStdString(feeBump->getErrors()[0])+")");
return false;
}
return true;
return false;
// std::unique_ptr<CFeeBumper> feeBump;
// {
// CCoinControl coin_control;
// coin_control.signalRbf = true;
// LOCK2(cs_main, wallet->cs_wallet);
// feeBump.reset(new CFeeBumper(wallet, hash, coin_control, 0));
// }
// if (feeBump->getResult() != BumpFeeResult::OK)
// {
// QMessageBox::critical(0, tr("Fee bump error"), tr("Increasing transaction fee failed") + "<br />(" +
// (feeBump->getErrors().size() ? QString::fromStdString(feeBump->getErrors()[0]) : "") +")");
// return false;
// }
//
// // allow a user based fee verification
// QString questionString = tr("Do you want to increase the fee?");
// questionString.append("<br />");
// CAmount oldFee = feeBump->getOldFee();
// CAmount newFee = feeBump->getNewFee();
// questionString.append("<table style=\"text-align: left;\">");
// questionString.append("<tr><td>");
// questionString.append(tr("Current fee:"));
// questionString.append("</td><td>");
// questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), oldFee));
// questionString.append("</td></tr><tr><td>");
// questionString.append(tr("Increase:"));
// questionString.append("</td><td>");
// questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), newFee - oldFee));
// questionString.append("</td></tr><tr><td>");
// questionString.append(tr("New fee:"));
// questionString.append("</td><td>");
// questionString.append(RavenUnits::formatHtmlWithUnit(getOptionsModel()->getDisplayUnit(), newFee));
// questionString.append("</td></tr></table>");
// SendConfirmationDialog confirmationDialog(tr("Confirm fee bump"), questionString);
// confirmationDialog.exec();
// QMessageBox::StandardButton retval = (QMessageBox::StandardButton)confirmationDialog.result();
//
// // cancel sign&broadcast if users doesn't want to bump the fee
// if (retval != QMessageBox::Yes) {
// return false;
// }
//
// WalletModel::UnlockContext ctx(requestUnlock());
// if(!ctx.isValid())
// {
// return false;
// }
//
// // sign bumped transaction
// bool res = false;
// {
// LOCK2(cs_main, wallet->cs_wallet);
// res = feeBump->signTransaction(wallet);
// }
// if (!res) {
// QMessageBox::critical(0, tr("Fee bump error"), tr("Can't sign transaction."));
// return false;
// }
// // commit the bumped transaction
// {
// LOCK2(cs_main, wallet->cs_wallet);
// res = feeBump->commit(wallet);
// }
// if(!res) {
// QMessageBox::critical(0, tr("Fee bump error"), tr("Could not commit transaction") + "<br />(" +
// QString::fromStdString(feeBump->getErrors()[0])+")");
// return false;
// }
// return true;
}

bool WalletModel::isWalletEnabled()
Expand Down
10 changes: 5 additions & 5 deletions src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "getnetworkhashps", 1, "height" },
{ "sendtoaddress", 1, "amount" },
{ "sendtoaddress", 4, "subtractfeefromamount" },
{ "sendtoaddress", 5 , "replaceable" },
{ "sendtoaddress", 6 , "conf_target" },
// { "sendtoaddress", 5 , "replaceable" },
{ "sendtoaddress", 5 , "conf_target" },
{ "settxfee", 0, "amount" },
{ "getreceivedbyaddress", 1, "minconf" },
{ "getreceivedbyaccount", 1, "minconf" },
Expand Down Expand Up @@ -91,8 +91,8 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "sendmany", 1, "amounts" },
{ "sendmany", 2, "minconf" },
{ "sendmany", 4, "subtractfeefrom" },
{ "sendmany", 5 , "replaceable" },
{ "sendmany", 6 , "conf_target" },
// { "sendmany", 5 , "replaceable" },
{ "sendmany", 5 , "conf_target" },
{ "addmultisigaddress", 0, "nrequired" },
{ "addmultisigaddress", 1, "keys" },
{ "createmultisig", 0, "nrequired" },
Expand All @@ -111,7 +111,7 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "createrawtransaction", 0, "inputs" },
{ "createrawtransaction", 1, "outputs" },
{ "createrawtransaction", 2, "locktime" },
{ "createrawtransaction", 3, "replaceable" },
// { "createrawtransaction", 3, "replaceable" },
{ "signrawtransaction", 1, "prevtxs" },
{ "signrawtransaction", 2, "privkeys" },
{ "sendrawtransaction", 1, "allowhighfees" },
Expand Down
Loading