From be62903c417293f6217e124669e62fd2172a18f1 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 12 Feb 2019 18:56:53 -0800 Subject: [PATCH] Make descriptor checksums mandatory in deriveaddresses and importmulti --- src/rpc/misc.cpp | 4 +-- src/wallet/rpcdump.cpp | 2 +- test/functional/rpc_deriveaddresses.py | 28 +++++++++-------- test/functional/wallet_importmulti.py | 42 +++++++++++++++++--------- 4 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index bfb86aa12b..999a307e2b 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -207,7 +207,7 @@ UniValue deriveaddresses(const JSONRPCRequest& request) }, RPCExamples{ "First three native segwit receive addresses\n" + - HelpExampleCli("deriveaddresses", "\"wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)\" 0 2") + HelpExampleCli("deriveaddresses", "\"wpkh([d34db33f/84h/0h/0h]xpub6DJ2dNUysrn5Vt36jH2KLBT2i1auw1tTSSomg8PhqNiUtx8QX2SvC9nrHu81fT41fvDUnhMjEzQgXnQjKEu3oaqMSzhSrHMxyyoEAmUHQbY/0/*)#trd0mf0l\" 0 2") }}.ToString() ); } @@ -233,7 +233,7 @@ UniValue deriveaddresses(const JSONRPCRequest& request) } FlatSigningProvider provider; - auto desc = Parse(desc_str, provider); + auto desc = Parse(desc_str, provider, /* require_checksum = */ true); if (!desc) { throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, strprintf("Invalid descriptor")); } diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 930274f8a1..66a52c1270 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -1117,7 +1117,7 @@ static UniValue ProcessImportDescriptor(ImportData& import_data, std::map