Merge pull request #1294 from psgreco/master-liquid-wallet-descr

Remove constrains on liquidv1 pegout bitcoin descriptor
This commit is contained in:
Byron Hambly 2023-11-23 11:45:30 +00:00 committed by GitHub
commit 2d298f7e3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(<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) == ")") {