Skip to content

Commit f50785a

Browse files
committed
Change default address type to bech32
1 parent ae3902e commit f50785a

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

src/wallet/wallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ enum WalletFeature
120120
};
121121

122122
//! Default for -addresstype
123-
constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::P2SH_SEGWIT};
123+
constexpr OutputType DEFAULT_ADDRESS_TYPE{OutputType::BECH32};
124124

125125
//! Default for -changetype
126126
constexpr OutputType DEFAULT_CHANGE_TYPE{OutputType::CHANGE_AUTO};

test/functional/feature_bip68_sequence.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
class BIP68Test(BitcoinTestFramework):
3030
def set_test_params(self):
3131
self.num_nodes = 2
32+
# TODO remove output type argument and fix resulting "tx-size-small" errors
3233
self.extra_args = [
33-
["-acceptnonstdtxn=1"],
34-
["-acceptnonstdtxn=0"],
34+
["-acceptnonstdtxn=1", "-addresstype=p2sh-segwit"],
35+
["-acceptnonstdtxn=0", "-addresstype=p2sh-segwit"],
3536
]
3637

3738
def skip_test_if_missing_module(self):

test/functional/feature_rbf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def make_utxo(node, amount, confirmed=True, scriptPubKey=CScript([1])):
6565
class ReplaceByFeeTest(BitcoinTestFramework):
6666
def set_test_params(self):
6767
self.num_nodes = 1
68+
# TODO remove output type argument and fix resulting "tx-size-small" errors
6869
self.extra_args = [
6970
[
7071
"-acceptnonstdtxn=1",
@@ -73,6 +74,7 @@ def set_test_params(self):
7374
"-limitancestorsize=101",
7475
"-limitdescendantcount=200",
7576
"-limitdescendantsize=101",
77+
"-addresstype=p2sh-segwit",
7678
],
7779
]
7880

test/functional/wallet_address_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def run_test(self):
345345
self.sync_blocks()
346346
assert_equal(self.nodes[4].getbalance(), 1)
347347

348-
self.log.info("Nodes with addresstype=legacy never use a P2WPKH change output")
348+
self.log.info("Nodes with addresstype=legacy never use a P2WPKH change output (unless changetype is set otherwise):")
349349
self.test_change_output_type(0, [to_address_bech32_1], 'legacy')
350350

351351
self.log.info("Nodes with addresstype=p2sh-segwit only use a P2WPKH change output if any destination address is bech32:")

test/functional/wallet_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def run_test(self):
317317
assert_raises_rpc_error(-5, "Invalid private key encoding", self.nodes[0].importprivkey, "invalid")
318318

319319
# This will raise an exception for importing an address with the PS2H flag
320-
temp_address = self.nodes[1].getnewaddress()
320+
temp_address = self.nodes[1].getnewaddress("", "p2sh-segwit")
321321
assert_raises_rpc_error(-5, "Cannot use the p2sh flag with an address - use a script instead", self.nodes[0].importaddress, temp_address, "label", False, True)
322322

323323
# This will raise an exception for attempting to dump the private key of an address you do not own

test/functional/wallet_bumpfee.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def set_test_params(self):
3838
"-walletrbf={}".format(i),
3939
"-mintxfee=0.00002",
4040
"-deprecatedrpc=totalFee",
41+
"-addresstype=p2sh-segwit", # TODO update constants in test and remove
4142
] for i in range(self.num_nodes)]
4243

4344
def skip_test_if_missing_module(self):

test/functional/wallet_import_with_label.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def run_test(self):
100100
"Test importprivkey won't label new dests with the same "
101101
"label as others labeled dests for the same key."
102102
)
103-
self.log.info("Import a watch-only legacy address with a label.")
104-
address4 = self.nodes[0].getnewaddress()
103+
self.log.info("Import a watch-only p2sh-segwit address with a label.")
104+
address4 = self.nodes[0].getnewaddress("", "p2sh-segwit")
105105
label4_addr = "Test Label 4 for importaddress"
106106
self.nodes[1].importaddress(address4, label4_addr)
107107
test_address(self.nodes[1],

0 commit comments

Comments
 (0)