Litecoin: Disable RBF
This commit is contained in:
parent
929059e26e
commit
0de5edb7e2
@ -1072,16 +1072,6 @@ Note: Since the fee is calculated on a per-byte basis, a fee of "100 satoshis p
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="optInRBF">
|
||||
<property name="text">
|
||||
<string>Enable Replace-By-Fee</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>With Replace-By-Fee (BIP-125) you can increase a transaction's fee after it is sent. Without this, a higher fee may be recommended to compensate for increased transaction delay risk.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -176,8 +176,9 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
||||
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::updateFeeSectionControls);
|
||||
connect(ui->groupFee, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||
connect(ui->customFee, &BitcoinAmountField::valueChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
|
||||
connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||
// Litecoin: Disable RBF
|
||||
// connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::updateSmartFeeLabel);
|
||||
// connect(ui->optInRBF, &QCheckBox::stateChanged, this, &SendCoinsDialog::coinControlUpdateLabels);
|
||||
CAmount requiredFee = model->wallet().getRequiredFee(1000);
|
||||
ui->customFee->SetMinValue(requiredFee);
|
||||
if (ui->customFee->value() < requiredFee) {
|
||||
@ -188,7 +189,8 @@ void SendCoinsDialog::setModel(WalletModel *_model)
|
||||
updateSmartFeeLabel();
|
||||
|
||||
// set default rbf checkbox state
|
||||
ui->optInRBF->setCheckState(Qt::Checked);
|
||||
// Litecoin: Disable RBF
|
||||
// ui->optInRBF->setCheckState(Qt::Checked);
|
||||
|
||||
if (model->wallet().privateKeysDisabled()) {
|
||||
ui->sendButton->setText(tr("Cr&eate Unsigned"));
|
||||
@ -334,6 +336,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
||||
question_string.append("</span><br />");
|
||||
|
||||
// append RBF message according to transaction's signalling
|
||||
/* Litecoin: Disable RBF
|
||||
question_string.append("<span style='font-size:10pt; font-weight:normal;'>");
|
||||
if (ui->optInRBF->isChecked()) {
|
||||
question_string.append(tr("You can increase the fee later (signals Replace-By-Fee, BIP-125)."));
|
||||
@ -341,6 +344,7 @@ bool SendCoinsDialog::PrepareSendText(QString& question_string, QString& informa
|
||||
question_string.append(tr("Not signalling Replace-By-Fee, BIP-125."));
|
||||
}
|
||||
question_string.append("</span>");
|
||||
*/
|
||||
}
|
||||
|
||||
// add total amount in all subdivision units
|
||||
@ -741,7 +745,8 @@ 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.m_signal_bip125_rbf = ui->optInRBF->isChecked();
|
||||
// Litecoin: Disable RBF GUI
|
||||
// ctrl.m_signal_bip125_rbf = ui->optInRBF->isChecked();
|
||||
// Include watch-only for wallets without private key
|
||||
ctrl.fAllowWatchOnly = model->wallet().privateKeysDisabled();
|
||||
}
|
||||
|
||||
@ -64,10 +64,12 @@ uint256 SendCoins(CWallet& wallet, SendCoinsDialog& sendCoinsDialog, const CTxDe
|
||||
SendCoinsEntry* entry = qobject_cast<SendCoinsEntry*>(entries->itemAt(0)->widget());
|
||||
entry->findChild<QValidatedLineEdit*>("payTo")->setText(QString::fromStdString(EncodeDestination(address)));
|
||||
entry->findChild<BitcoinAmountField*>("payAmount")->setValue(amount);
|
||||
/* Litecon: Disabled RBF UI
|
||||
sendCoinsDialog.findChild<QFrame*>("frameFee")
|
||||
->findChild<QFrame*>("frameFeeSelection")
|
||||
->findChild<QCheckBox*>("optInRBF")
|
||||
->setCheckState(rbf ? Qt::Checked : Qt::Unchecked);
|
||||
*/
|
||||
uint256 txid;
|
||||
boost::signals2::scoped_connection c(wallet.NotifyTransactionChanged.connect([&txid](CWallet*, const uint256& hash, ChangeType status) {
|
||||
if (status == CT_NEW) txid = hash;
|
||||
@ -93,6 +95,7 @@ QModelIndex FindTx(const QAbstractItemModel& model, const uint256& txid)
|
||||
}
|
||||
|
||||
//! Invoke bumpfee on txid and check results.
|
||||
/* Litecoin: Disable RBF
|
||||
void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, std::string expectError, bool cancel)
|
||||
{
|
||||
QTableView* table = view.findChild<QTableView*>("transactionView");
|
||||
@ -117,6 +120,7 @@ void BumpFee(TransactionView& view, const uint256& txid, bool expectDisabled, st
|
||||
action->trigger();
|
||||
QVERIFY(text.indexOf(QString::fromStdString(expectError)) != -1);
|
||||
}
|
||||
*/
|
||||
|
||||
//! Simple qt wallet tests.
|
||||
//
|
||||
@ -191,10 +195,11 @@ void TestGUI(interfaces::Node& node)
|
||||
QVERIFY(FindTx(*transactionTableModel, txid2).isValid());
|
||||
|
||||
// Call bumpfee. Test disabled, canceled, enabled, then failing cases.
|
||||
BumpFee(transactionView, txid1, true /* expect disabled */, "not BIP 125 replaceable" /* expected error */, false /* cancel */);
|
||||
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);
|
||||
BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);
|
||||
BumpFee(transactionView, txid2, true /* expect disabled */, "already bumped" /* expected error */, false /* cancel */);
|
||||
// Litecoin: Disable BumpFee tests
|
||||
// BumpFee(transactionView, txid1, true /* expect disabled */, "not BIP 125 replaceable" /* expected error */, false /* cancel */);
|
||||
// BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, true /* cancel */);
|
||||
// BumpFee(transactionView, txid2, false /* expect disabled */, {} /* expected error */, false /* cancel */);
|
||||
// BumpFee(transactionView, txid2, true /* expect disabled */, "already bumped" /* expected error */, false /* cancel */);
|
||||
|
||||
// Check current balance on OverviewPage
|
||||
OverviewPage overviewPage(platformStyle.get());
|
||||
|
||||
@ -75,7 +75,7 @@ static const bool DEFAULT_CHECKPOINTS_ENABLED = true;
|
||||
static const bool DEFAULT_TXINDEX = false;
|
||||
static const char* const DEFAULT_BLOCKFILTERINDEX = "0";
|
||||
/** Default for -persistmempool */
|
||||
static const bool DEFAULT_PERSIST_MEMPOOL = true;
|
||||
static const bool DEFAULT_PERSIST_MEMPOOL = false;
|
||||
/** Default for using fee filter */
|
||||
static const bool DEFAULT_FEEFILTER = true;
|
||||
/** Default for -stopatheight */
|
||||
|
||||
@ -74,6 +74,7 @@ class ReplaceByFeeTest(BitcoinTestFramework):
|
||||
"-limitancestorsize=101",
|
||||
"-limitdescendantcount=200",
|
||||
"-limitdescendantsize=101",
|
||||
"-mempoolreplacement=1",
|
||||
],
|
||||
]
|
||||
self.supports_cli = False
|
||||
|
||||
@ -41,7 +41,7 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 1
|
||||
self.extra_args = [[
|
||||
'-txindex','-permitbaremultisig=0',
|
||||
'-txindex', '-mempoolreplacement=1', '-permitbaremultisig=0',
|
||||
]] * self.num_nodes
|
||||
self.supports_cli = False
|
||||
|
||||
|
||||
@ -220,9 +220,9 @@ class SegWitTest(BitcoinTestFramework):
|
||||
self.num_nodes = 3
|
||||
# This test tests SegWit both pre and post-activation, so use the normal BIP9 activation.
|
||||
self.extra_args = [
|
||||
["-acceptnonstdtxn=1", "-segwitheight={}".format(SEGWIT_HEIGHT), "-whitelist=noban@127.0.0.1"],
|
||||
["-acceptnonstdtxn=0", "-segwitheight={}".format(SEGWIT_HEIGHT)],
|
||||
["-acceptnonstdtxn=1", "-segwitheight=-1"],
|
||||
["-acceptnonstdtxn=1", "-segwitheight={}".format(SEGWIT_HEIGHT), "-whitelist=noban@127.0.0.1", "-mempoolreplacement=1"],
|
||||
["-acceptnonstdtxn=0", "-segwitheight={}".format(SEGWIT_HEIGHT), "-mempoolreplacement=1"],
|
||||
["-acceptnonstdtxn=1", "-segwitheight=-1"], "-mempoolreplacement=1",
|
||||
]
|
||||
self.supports_cli = False
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ import io
|
||||
|
||||
from test_framework.blocktools import add_witness_commitment, create_block, create_coinbase, send_to_witness
|
||||
from test_framework.messages import BIP125_SEQUENCE_NUMBER, CTransaction
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.test_framework import BitcoinTestFramework, SkipTest
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
assert_greater_than,
|
||||
@ -56,6 +56,7 @@ class BumpFeeTest(BitcoinTestFramework):
|
||||
self.sync_all()
|
||||
|
||||
def run_test(self):
|
||||
|
||||
# Encrypt wallet for test_locked_wallet_fails test
|
||||
self.nodes[1].encryptwallet(WALLET_PASSPHRASE)
|
||||
self.nodes[1].walletpassphrase(WALLET_PASSPHRASE, WALLET_PASSPHRASE_TIMEOUT)
|
||||
@ -567,7 +568,7 @@ def submit_block_with_tx(node, tx):
|
||||
tip = node.getbestblockhash()
|
||||
height = node.getblockcount() + 1
|
||||
block_time = node.getblockheader(tip)["mediantime"] + 1
|
||||
block = create_block(int(tip, 16), create_coinbase(height), block_time)
|
||||
block = create_block(int(tip, 16), create_coinbase(height), block_time, version=0x20000000)
|
||||
block.vtx.append(ctx)
|
||||
block.rehash()
|
||||
block.hashMerkleRoot = block.calc_merkle_root()
|
||||
|
||||
@ -23,6 +23,9 @@ def tx_from_hex(hexstring):
|
||||
class ListTransactionsTest(BitcoinTestFramework):
|
||||
def set_test_params(self):
|
||||
self.num_nodes = 2
|
||||
self.extra_args = [[
|
||||
"-mempoolreplacement=1",
|
||||
] for i in range(self.num_nodes)]
|
||||
|
||||
def skip_test_if_missing_module(self):
|
||||
self.skip_if_no_wallet()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user