mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
don't require claim_script to be witness program for raw claim pegin
This commit is contained in:
parent
da6960ddb7
commit
6cc380a525
1 changed files with 1 additions and 5 deletions
|
|
@ -3571,13 +3571,9 @@ UniValue createrawpegin(const JSONRPCRequest& request)
|
|||
CScript witnessProgScript;
|
||||
unsigned int nOut = txBTC.vout.size();
|
||||
if (request.params.size() > 2) {
|
||||
int version = -1;
|
||||
std::vector<unsigned char> witnessProgram;
|
||||
// If given manually, no need for it to be a witness script
|
||||
std::vector<unsigned char> witnessBytes(ParseHex(request.params[2].get_str()));
|
||||
witnessProgScript = CScript(witnessBytes.begin(), witnessBytes.end());
|
||||
if (!witnessProgScript.IsWitnessProgram(version, witnessProgram) || version != 0) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Given claim_script is not a valid v0 witness program.");
|
||||
}
|
||||
nOut = GetPeginTxnOutputIndex(txBTC, witnessProgScript);
|
||||
if (nOut == txBTC.vout.size()) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Given claim_script does not match the given Bitcoin transaction.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue