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
1 change: 0 additions & 1 deletion src/rpc/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ static const CRPCConvertParam vRPCConvertParams[] =
{ "prioritisetransaction", 1, "fee_delta" },
{ "setban", 2, "bantime" },
{ "setban", 3, "absolute" },
{ "setbip69enabled", 0, "enabled" },
{ "setnetworkactive", 0, "state" },
{ "setprivatesendrounds", 0, "rounds" },
{ "setprivatesendamount", 0, "amount" },
Expand Down
23 changes: 0 additions & 23 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3064,27 +3064,6 @@ UniValue fundrawtransaction(const JSONRPCRequest& request)
return result;
}

UniValue setbip69enabled(const JSONRPCRequest& request)
{
CWallet* const pwallet = GetWalletForJSONRPCRequest(request);
if (!EnsureWalletIsAvailable(pwallet, request.fHelp))
return NullUniValue;

if (request.fHelp || request.params.size() != 1)
throw std::runtime_error(
"setbip69enabled enable\n"
"\nEnable/Disable BIP69 input/output sorting (-regtest only)\n"
"\nArguments:\n"
"1. enable (bool, required) true or false"
);
if (Params().NetworkIDString() != CBaseChainParams::REGTEST)
throw std::runtime_error("setbip69enabled for regression testing (-regtest mode) only");

bBIP69Enabled = request.params[0].get_bool();

return NullUniValue;
}

#if ENABLE_MINER
UniValue generate(const JSONRPCRequest& request)
{
Expand Down Expand Up @@ -3208,8 +3187,6 @@ static const CRPCCommand commands[] =
{ "hidden", "instantsendtoaddress", &instantsendtoaddress, false, {"address","amount","comment","comment_to","subtractfeefromamount"} },
{ "wallet", "dumphdinfo", &dumphdinfo, true, {} },
{ "wallet", "importelectrumwallet", &importelectrumwallet, true, {"filename", "index"} },

{ "hidden", "setbip69enabled", &setbip69enabled, true, {} },
};

void RegisterWalletRPCCommands(CRPCTable &t)
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ std::vector<CWalletRef> vpwallets;
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
unsigned int nTxConfirmTarget = DEFAULT_TX_CONFIRM_TARGET;
bool bSpendZeroConfChange = DEFAULT_SPEND_ZEROCONF_CHANGE;
bool bBIP69Enabled = true;

const char * DEFAULT_WALLET_DAT = "wallet.dat";

Expand Down Expand Up @@ -3756,7 +3755,8 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
txNew.vin.push_back(txin);
}

if (bBIP69Enabled) {
// If no specific change position was requested, apply BIP69
if (nChangePosRequest == -1) {
std::sort(txNew.vin.begin(), txNew.vin.end(), CompareInputBIP69());
std::sort(vecTxDSInTmp.begin(), vecTxDSInTmp.end(), CompareInputBIP69());
std::sort(txNew.vout.begin(), txNew.vout.end(), CompareOutputBIP69());
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ extern std::vector<CWalletRef> vpwallets;
extern CFeeRate payTxFee;
extern unsigned int nTxConfirmTarget;
extern bool bSpendZeroConfChange;
extern bool bBIP69Enabled;

static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
//! -paytxfee default
Expand Down
6 changes: 0 additions & 6 deletions test/functional/fundrawtransaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,9 +667,6 @@ def run_test(self):
# Make sure there is exactly one input so coin selection can't skew the result
assert_equal(len(self.nodes[3].listunspent(1)), 1)

# Disable BIP69 sorting of inputs and outputs
self.nodes[3].setbip69enabled(False)

inputs = []
outputs = {self.nodes[2].getnewaddress(): 1}
rawtx = self.nodes[3].createrawtransaction(inputs, outputs)
Expand Down Expand Up @@ -732,8 +729,5 @@ def run_test(self):
# the total subtracted from the outputs is equal to the fee
assert_equal(share[0] + share[2] + share[3], result[0]['fee'])

# Reenable BIP69 sorting of inputs and outputs
self.nodes[3].setbip69enabled(True)

if __name__ == '__main__':
RawTransactionsTest().main()