Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove constrains on liquidv1 pegout bitcoin descriptor #1294

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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