Skip to content

Commit a7476bb

Browse files
committed
fix: create descriptor wallets by default
1 parent a9b7578 commit a7476bb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

coldcore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,13 @@ def init_wallet_in_core(config, rpc, wallet) -> BitcoinRPC:
21532153
F.done(f"created wallet {yellow(wallet.name)} in Core as watch-only")
21542154

21552155
rpcw = config.rpc(wallet)
2156-
rpcw.importmulti(*wallet.importmulti_args())
2156+
try:
2157+
rpcw.importmulti(*wallet.importmulti_args())
2158+
except JSONRPCError:
2159+
# Could be a descriptor wallet, try that.
2160+
# TODO: make descriptor wallet status a first class piece of metadata.
2161+
rpcw.importdescriptors(*wallet.importmulti_args())
2162+
21572163
F.done("imported descriptors 0/* and 1/* (change)")
21582164

21592165
scan_result = {} # type: ignore
@@ -2852,7 +2858,7 @@ def rpc_wallet_create(rpc: BitcoinRPC, wall: Wallet):
28522858
True, # blank
28532859
None, # passphrase
28542860
False, # avoid_reuse
2855-
False, # descriptors
2861+
True, # descriptors
28562862
)
28572863
except JSONRPCError as e:
28582864
if not _is_already_loaded_err(e):

0 commit comments

Comments
 (0)