Skip to content

Commit

Permalink
Merge pull request ElementsProject#1294 from psgreco/master-liquid-wa…
Browse files Browse the repository at this point in the history
…llet-descr

Remove constrains on liquidv1 pegout bitcoin descriptor
  • Loading branch information
delta1 authored Nov 23, 2023
2 parents 1b65d4d + d66c283 commit 2d298f7
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/wallet/rpc/elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) == ")") {
Expand Down

0 comments on commit 2d298f7

Please sign in to comment.