From 33d9be11d0e70cebefe1c9bdb006b494a0b37c53 Mon Sep 17 00:00:00 2001 From: Oghenovo Usiwoma <37949128+Eunovo@users.noreply.github.com> Date: Sun, 4 Aug 2024 09:12:21 +0100 Subject: [PATCH] Allow ext keys (#3) * rpc/deriveaddress: Add support for sp desc * spscriptpubkeyman: Move labelled destination generation to seperate methods * rpc/getnewaddress: Add silent-payment to addess_type list * descriptor: Allow extended keys in sp() * Fix scan key storage issues in watch only wallet - Stop adding scan key to singingprovider private key map, this will prevent scan key from being counted among private keys - Stop storing scan keys to db, scan keys are already saved in descriptor * spscriptpubkeyman: Fix MarkUnusedAddresses SegFault DescriptorScriptPubKeyMan::MarkUnusedAddresses tries to expand the descriptor and read the resulting scripts This does not work for sp descriptors as no scripts are returned This leads to a SegFault * test: Add E2E test for sp descriptor --- src/addresstype.h | 15 ++ src/rpc/output_script.cpp | 4 + src/script/descriptor.cpp | 129 +++++++++++++----- src/silentpaymentkey.h | 12 ++ src/test/descriptor_tests.cpp | 68 +++++++++ src/wallet/rpc/addresses.cpp | 2 +- src/wallet/rpc/backup.cpp | 2 +- src/wallet/scriptpubkeyman.cpp | 50 +++++-- src/wallet/scriptpubkeyman.h | 5 + src/wallet/wallet.cpp | 13 ++ src/wallet/walletutil.cpp | 4 +- test/functional/wallet_miniscript.py | 112 +++++++++------ .../wallet_silentpayments_receiving.py | 8 +- 13 files changed, 335 insertions(+), 89 deletions(-) diff --git a/src/addresstype.h b/src/addresstype.h index 446593b90a6765..2af91f4dc8cb23 100644 --- a/src/addresstype.h +++ b/src/addresstype.h @@ -8,6 +8,7 @@ #include #include #include