Merge branch 'master' into elem-23.2.2-rc1

This commit is contained in:
Pablo Greco 2024-04-19 11:00:45 -07:00
commit a71bddef0e
2 changed files with 5 additions and 8 deletions

View file

@ -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<unsigned char> 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);

View file

@ -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");
@ -361,18 +365,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(<xpub>) or <xpub>.");
}
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(<xpub>) or <xpub>.");
}
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) == ")") {