mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Temp disable pegout descriptors that are not pkh()
This commit is contained in:
parent
19c477edea
commit
bf86c44666
1 changed files with 7 additions and 0 deletions
|
|
@ -4991,11 +4991,18 @@ UniValue initpegoutwallet(const JSONRPCRequest& request)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Three acceptable descriptors:
|
// Three acceptable descriptors:
|
||||||
|
bool is_liquid = Params().NetworkIDString() == "liquidv1";
|
||||||
if (bitcoin_desc.substr(0, 8) == "sh(wpkh("
|
if (bitcoin_desc.substr(0, 8) == "sh(wpkh("
|
||||||
&& bitcoin_desc.substr(bitcoin_desc.size()-2, 2) == "))") {
|
&& 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);
|
xpub_str = bitcoin_desc.substr(8, bitcoin_desc.size()-2);
|
||||||
} else if (bitcoin_desc.substr(0, 5) == "wpkh("
|
} else if (bitcoin_desc.substr(0, 5) == "wpkh("
|
||||||
&& bitcoin_desc.substr(bitcoin_desc.size()-1, 1) == ")") {
|
&& 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);
|
xpub_str = bitcoin_desc.substr(5, bitcoin_desc.size()-1);
|
||||||
} else if (bitcoin_desc.substr(0, 4) == "pkh("
|
} else if (bitcoin_desc.substr(0, 4) == "pkh("
|
||||||
&& bitcoin_desc.substr(bitcoin_desc.size()-1, 1) == ")") {
|
&& bitcoin_desc.substr(bitcoin_desc.size()-1, 1) == ")") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue