mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Temp disable pegout descriptors that are not pkh()
This commit is contained in:
parent
fdba8c45f9
commit
28dac17c4d
1 changed files with 7 additions and 0 deletions
|
|
@ -4996,11 +4996,18 @@ UniValue initpegoutwallet(const JSONRPCRequest& request)
|
|||
}
|
||||
|
||||
// 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) == ")") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue