Qt/Options: Configure blockreconstructionextratxn using rwconf

This commit is contained in:
Luke Dashjr 2017-02-07 23:28:03 +00:00
parent 8102b5aa39
commit e8f3dbeb28
4 changed files with 25 additions and 0 deletions

View File

@ -200,6 +200,17 @@ OptionsDialog::OptionsDialog(QWidget* parent, bool enableWallet)
ui->verticalLayout_Wallet->insertWidget(0, walletrbf);
FixTabOrder(walletrbf);
/* Network tab */
QLayoutItem *spacer = ui->verticalLayout_Network->takeAt(ui->verticalLayout_Network->count() - 1);
prevwidget = dynamic_cast<QWidgetItem*>(ui->verticalLayout_Network->itemAt(ui->verticalLayout_Network->count() - 1))->widget();
blockreconstructionextratxn = new QSpinBox(ui->tabNetwork);
blockreconstructionextratxn->setMinimum(0);
blockreconstructionextratxn->setMaximum(std::numeric_limits<int>::max());
CreateOptionUI(ui->verticalLayout_Network, blockreconstructionextratxn, tr("Keep at most %s extra transactions in memory for compact block reconstruction"));
ui->verticalLayout_Network->addItem(spacer);
prevwidget = ui->peerbloomfilters;
/* Mempool tab */
@ -550,6 +561,8 @@ void OptionsDialog::setMapper()
ui->peerblockfilters->setToolTip(ui->peerblockfilters->toolTip() + " " + tr("(only available if enabled at least once before turning on pruning)"));
}
mapper->addMapping(blockreconstructionextratxn, OptionsModel::blockreconstructionextratxn);
/* Mempool tab */
QVariant current_mempoolreplacement = model->data(model->index(OptionsModel::mempoolreplacement, 0), Qt::EditRole);

View File

@ -96,6 +96,8 @@ private:
QCheckBox *walletrbf;
QSpinBox *blockreconstructionextratxn;
QValueComboBox *mempoolreplacement;
QSpinBox *maxorphantx;
QSpinBox *maxmempool;

View File

@ -675,6 +675,8 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
return qlonglong(gArgs.GetIntArg("-blockprioritysize", DEFAULT_BLOCK_PRIORITY_SIZE) / 1000);
case blockmaxweight:
return qlonglong(gArgs.GetIntArg("-blockmaxweight", DEFAULT_BLOCK_MAX_WEIGHT) / 1000);
case blockreconstructionextratxn:
return qlonglong(gArgs.GetIntArg("-blockreconstructionextratxn", DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN));
default:
return QVariant();
}
@ -1176,6 +1178,13 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
gArgs.ModifyRWConfigFile(strKey, strNv);
}
break;
case blockreconstructionextratxn:
if (changed()) {
std::string strNv = value.toString().toStdString();
gArgs.ForceSetArg("-blockreconstructionextratxn", strNv);
gArgs.ModifyRWConfigFile("blockreconstructionextratxn", strNv);
}
break;
default:
break;
}

View File

@ -98,6 +98,7 @@ public:
blockmaxsize,
blockprioritysize,
blockmaxweight,
blockreconstructionextratxn,
OptionIDRowCount,
};