fix change address derivation (#1304)

This commit is contained in:
Stepan Snigirev 2021-07-14 22:05:59 +02:00 committed by GitHub
parent b37a2b7796
commit ce1e516440
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -400,8 +400,8 @@ class LWallet(Wallet):
# looks like change_type is required in nested segwit wallets
# but not in native segwit
if "changeAddress" not in options and "sh(" in self.change_descriptor:
options["change_type"] = "p2sh-segwit"
if "changeAddress" not in options and self.address_type:
options["change_type"] = self.address_type
r = self.rpc.walletcreatefundedpsbt(
extra_inputs, # inputs
@ -438,8 +438,8 @@ class LWallet(Wallet):
# looks like change_type is required in nested segwit wallets
# but not in native segwit
if "changeAddress" not in options and "sh(" in self.change_descriptor:
options["change_type"] = "p2sh-segwit"
if "changeAddress" not in options and self.address_type:
options["change_type"] = self.address_type
if fee_rate > 0.0:
if not existing_psbt: