Skip to content

Commit 29a21c9

Browse files
committed
[rpc] set default bip32derivs to true for psbt methods
1 parent e9f73b8 commit 29a21c9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

doc/release-notes-17264.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Updated RPCs
2+
------------
3+
4+
- `walletprocesspsbt` and `walletcreatefundedpsbt` now include BIP 32 derivation paths by default for public keys if we know them. This can be disabled by setting `bip32derivs` to `false`.

src/wallet/psbtwallet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ NODISCARD TransactionError FillPSBT(const CWallet* pwallet,
2727
bool& complete,
2828
int sighash_type = 1 /* SIGHASH_ALL */,
2929
bool sign = true,
30-
bool bip32derivs = false);
30+
bool bip32derivs = true);
3131

3232
#endif // BITCOIN_WALLET_PSBTWALLET_H

src/wallet/rpcwallet.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3984,7 +3984,7 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
39843984
" \"ALL|ANYONECANPAY\"\n"
39853985
" \"NONE|ANYONECANPAY\"\n"
39863986
" \"SINGLE|ANYONECANPAY\""},
3987-
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "false", "If true, includes the BIP 32 derivation paths for public keys if we know them"},
3987+
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "true", "Include BIP 32 derivation paths for public keys if we know them"},
39883988
},
39893989
RPCResult{
39903990
"{\n"
@@ -4012,7 +4012,7 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
40124012

40134013
// Fill transaction with our data and also sign
40144014
bool sign = request.params[1].isNull() ? true : request.params[1].get_bool();
4015-
bool bip32derivs = request.params[3].isNull() ? false : request.params[3].get_bool();
4015+
bool bip32derivs = request.params[3].isNull() ? true : request.params[3].get_bool();
40164016
bool complete = true;
40174017
const TransactionError err = FillPSBT(pwallet, psbtx, complete, nHashType, sign, bip32derivs);
40184018
if (err != TransactionError::OK) {
@@ -4095,7 +4095,7 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
40954095
" \"CONSERVATIVE\""},
40964096
},
40974097
"options"},
4098-
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "false", "If true, includes the BIP 32 derivation paths for public keys if we know them"},
4098+
{"bip32derivs", RPCArg::Type::BOOL, /* default */ "true", "Include BIP 32 derivation paths for public keys if we know them"},
40994099
},
41004100
RPCResult{
41014101
"{\n"
@@ -4134,7 +4134,7 @@ UniValue walletcreatefundedpsbt(const JSONRPCRequest& request)
41344134
PartiallySignedTransaction psbtx(rawTx);
41354135

41364136
// Fill transaction with out data but don't sign
4137-
bool bip32derivs = request.params[4].isNull() ? false : request.params[4].get_bool();
4137+
bool bip32derivs = request.params[4].isNull() ? true : request.params[4].get_bool();
41384138
bool complete = true;
41394139
const TransactionError err = FillPSBT(pwallet, psbtx, complete, 1, false, bip32derivs);
41404140
if (err != TransactionError::OK) {

0 commit comments

Comments
 (0)