aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/rpcwallet.cpp
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2019-08-04 17:56:17 +0200
committerSjors Provoost <sjors@sprovoost.nl>2021-02-23 14:34:31 +0100
commit2655197e1c2dea9536c32afe1482ced4a1f481e9 (patch)
tree05521f4f4c473073f68d6bfce518472b5b6cc0de /src/wallet/rpcwallet.cpp
parent2700f09c4130af6167ce71f46960e92ca800e205 (diff)
downloadbitcoin-2655197e1c2dea9536c32afe1482ced4a1f481e9.tar.xz
rpc: add external_signer option to createwallet
Diffstat (limited to 'src/wallet/rpcwallet.cpp')
-rw-r--r--src/wallet/rpcwallet.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp
index 53232db6bc..9d61f6fbe2 100644
--- a/src/wallet/rpcwallet.cpp
+++ b/src/wallet/rpcwallet.cpp
@@ -2726,6 +2726,7 @@ static RPCHelpMan createwallet()
{"avoid_reuse", RPCArg::Type::BOOL, /* default */ "false", "Keep track of coin reuse, and treat dirty and clean coins differently with privacy considerations in mind."},
{"descriptors", RPCArg::Type::BOOL, /* default */ "false", "Create a native descriptor wallet. The wallet will use descriptors internally to handle address creation"},
{"load_on_startup", RPCArg::Type::BOOL, /* default */ "null", "Save wallet name to persistent settings and load on startup. True to add wallet to startup list, false to remove, null to leave unchanged."},
+ {"external_signer", RPCArg::Type::BOOL, /* default */ "false", "Use an external signer such as a hardware wallet. Requires -signer to be configured. Wallet creation will fail if keys cannot be fetched. Requires disable_private_keys and descriptors set to true."},
},
RPCResult{
RPCResult::Type::OBJ, "", "",
@@ -2770,6 +2771,13 @@ static RPCHelpMan createwallet()
flags |= WALLET_FLAG_DESCRIPTORS;
warnings.emplace_back(Untranslated("Wallet is an experimental descriptor wallet"));
}
+ if (!request.params[7].isNull() && request.params[7].get_bool()) {
+#ifdef ENABLE_EXTERNAL_SIGNER
+ flags |= WALLET_FLAG_EXTERNAL_SIGNER;
+#else
+ throw JSONRPCError(RPC_WALLET_ERROR, "Configure with --enable-external-signer to use this");
+#endif
+ }
#ifndef USE_BDB
if (!(flags & WALLET_FLAG_DESCRIPTORS)) {