Skip to content

Commit 6cc380a

Browse files
committed
don't require claim_script to be witness program for raw claim pegin
1 parent da6960d commit 6cc380a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/wallet/rpcwallet.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3571,13 +3571,9 @@ UniValue createrawpegin(const JSONRPCRequest& request)
35713571
CScript witnessProgScript;
35723572
unsigned int nOut = txBTC.vout.size();
35733573
if (request.params.size() > 2) {
3574-
int version = -1;
3575-
std::vector<unsigned char> witnessProgram;
3574+
// If given manually, no need for it to be a witness script
35763575
std::vector<unsigned char> witnessBytes(ParseHex(request.params[2].get_str()));
35773576
witnessProgScript = CScript(witnessBytes.begin(), witnessBytes.end());
3578-
if (!witnessProgScript.IsWitnessProgram(version, witnessProgram) || version != 0) {
3579-
throw JSONRPCError(RPC_INVALID_PARAMETER, "Given claim_script is not a valid v0 witness program.");
3580-
}
35813577
nOut = GetPeginTxnOutputIndex(txBTC, witnessProgScript);
35823578
if (nOut == txBTC.vout.size()) {
35833579
throw JSONRPCError(RPC_INVALID_PARAMETER, "Given claim_script does not match the given Bitcoin transaction.");

0 commit comments

Comments
 (0)