Skip to content

Commit da2bc86

Browse files
committed
[wallet] don't create long chains by default
1 parent c9ed992 commit da2bc86

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static const CAmount WALLET_INCREMENTAL_RELAY_FEE = 5000;
9595
//! Default for -spendzeroconfchange
9696
static const bool DEFAULT_SPEND_ZEROCONF_CHANGE = true;
9797
//! Default for -walletrejectlongchains
98-
static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS = false;
98+
static const bool DEFAULT_WALLET_REJECT_LONG_CHAINS{true};
9999
//! -txconfirmtarget default
100100
static const unsigned int DEFAULT_TX_CONFIRM_TARGET = 6;
101101
//! -walletrbf default

test/functional/wallet_balance.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def set_test_params(self):
5050
self.num_nodes = 2
5151
self.setup_clean_chain = True
5252
self.extra_args = [
53-
['-limitdescendantcount=3'], # Limit mempool descendants as a hack to have wallet txs rejected from the mempool
53+
# Limit mempool descendants as a hack to have wallet txs rejected from the mempool.
54+
# Set walletrejectlongchains=0 so the wallet still creates the transactions.
55+
['-limitdescendantcount=3', '-walletrejectlongchains=0'],
5456
[],
5557
]
5658

test/functional/wallet_basic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class WalletTest(BitcoinTestFramework):
2525
def set_test_params(self):
2626
self.num_nodes = 4
2727
self.extra_args = [[
28-
"-acceptnonstdtxn=1",
28+
"-acceptnonstdtxn=1", "-walletrejectlongchains=0"
2929
]] * self.num_nodes
3030
self.setup_clean_chain = True
3131
self.supports_cli = False
@@ -142,7 +142,7 @@ def run_test(self):
142142
self.nodes[2].lockunspent(False, [unspent_0], True)
143143

144144
# Restarting the node with the lock written to the wallet should keep the lock
145-
self.restart_node(2)
145+
self.restart_node(2, ["-walletrejectlongchains=0"])
146146
assert_raises_rpc_error(-8, "Invalid parameter, output already locked", self.nodes[2].lockunspent, False, [unspent_0])
147147

148148
# Unloading and reloading the wallet with a persistent lock should keep the lock
@@ -568,7 +568,7 @@ def run_test(self):
568568
self.log.info("Test -reindex")
569569
self.stop_nodes()
570570
# set lower ancestor limit for later
571-
self.start_node(0, ['-reindex', "-limitancestorcount=" + str(chainlimit)])
571+
self.start_node(0, ['-reindex', "-walletrejectlongchains=0", "-limitancestorcount=" + str(chainlimit)])
572572
self.start_node(1, ['-reindex', "-limitancestorcount=" + str(chainlimit)])
573573
self.start_node(2, ['-reindex', "-limitancestorcount=" + str(chainlimit)])
574574
# reindex will leave rpc warm up "early"; Wait for it to finish

0 commit comments

Comments
 (0)