Skip to content

Commit

Permalink
Temp disable pegout descriptors that are not pkh()
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Sep 30, 2019
1 parent fdba8c4 commit 28dac17
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) == ")") {
Expand Down

0 comments on commit 28dac17

Please sign in to comment.