From d66c283f0676469c1a1af5883081d44c29344298 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Wed, 22 Nov 2023 09:11:17 -0800 Subject: [PATCH 1/3] Remove constrains on liquidv1 pegout bitcoin descriptor --- src/wallet/rpc/elements.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/wallet/rpc/elements.cpp b/src/wallet/rpc/elements.cpp index 296d8b8561..612f67541e 100644 --- a/src/wallet/rpc/elements.cpp +++ b/src/wallet/rpc/elements.cpp @@ -361,18 +361,11 @@ RPCHelpMan initpegoutwallet() } // Three acceptable descriptors: - bool is_liquid = Params().NetworkIDString() == "liquidv1"; if (bitcoin_desc.substr(0, 8) == "sh(wpkh(" && bitcoin_desc.substr(bitcoin_desc.size()-2, 2) == "))") { - if(is_liquid) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "bitcoin_descriptor is not supported by Liquid; try pkh() or ."); - } xpub_str = bitcoin_desc.substr(8, bitcoin_desc.size()-2); } else if (bitcoin_desc.substr(0, 5) == "wpkh(" && bitcoin_desc.substr(bitcoin_desc.size()-1, 1) == ")") { - if(is_liquid) { - throw JSONRPCError(RPC_INVALID_PARAMETER, "bitcoin_descriptor is not supported by Liquid; try pkh() or ."); - } xpub_str = bitcoin_desc.substr(5, bitcoin_desc.size()-1); } else if (bitcoin_desc.substr(0, 4) == "pkh(" && bitcoin_desc.substr(bitcoin_desc.size()-1, 1) == ")") { From 605acb0a4005da6a26f3ee61020f9ace394d31cc Mon Sep 17 00:00:00 2001 From: snoppy Date: Sun, 31 Mar 2024 23:07:05 +0800 Subject: [PATCH 2/3] chore: fix typos --- src/chainparams.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 26c3948938..a3ad97661c 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -842,7 +842,7 @@ protected: // Determines type of genesis block consensus.genesis_style = args.GetArg("-con_genesis_style", "elements"); - // Block signing encumberance script, default of 51 aka OP_TRUE + // Block signing encumbrance script, default of 51 aka OP_TRUE std::vector sign_bytes = ParseHex(args.GetArg("-signblockscript", default_signblockscript)); consensus.signblockscript = CScript(sign_bytes.begin(), sign_bytes.end()); consensus.max_block_signature_size = args.GetIntArg("-con_max_block_sig_size", consensus.max_block_signature_size); From 33a15604e8b3254321ea3456b9d2d96d2a7288d3 Mon Sep 17 00:00:00 2001 From: Pablo Greco Date: Thu, 18 Apr 2024 17:41:36 -0700 Subject: [PATCH 3/3] getpeginaddress cannot be trusted during ibd, it should fail --- src/wallet/rpc/elements.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/rpc/elements.cpp b/src/wallet/rpc/elements.cpp index 612f67541e..3bfa4253a2 100644 --- a/src/wallet/rpc/elements.cpp +++ b/src/wallet/rpc/elements.cpp @@ -174,6 +174,10 @@ RPCHelpMan getpeginaddress() if (!wallet) return NullUniValue; CWallet* const pwallet = wallet.get(); + if (pwallet->chain().isInitialBlockDownload()) { + throw JSONRPCError(RPC_WALLET_ERROR, "This action cannot be completed during initial sync or reindexing."); + } + LegacyScriptPubKeyMan* spk_man = pwallet->GetLegacyScriptPubKeyMan(); if (!spk_man) { throw JSONRPCError(RPC_WALLET_ERROR, "This type of wallet does not support this command");