QA: Allow setting the fedpeg script with a command line argument

- In both default and regtest modes
- The script is stored
- BaseSignatureChecker is used to pass it to the interpreter

Modified by jtimon
This commit is contained in:
Jonas Nick 2016-03-22 23:06:10 +01:00 committed by Gregory Sanders
parent 4ad6b57068
commit 1287eaa0d9
9 changed files with 26 additions and 12 deletions

View file

@ -99,7 +99,7 @@ static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptP
if (amountPreviousInput.IsAmount() && (amountPreviousInput.GetAmount() < -1 || (nIn != 0 && !MoneyRange(amountPreviousInput.GetAmount()))))
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionNoWithdrawsSignatureChecker(&tx, nIn, amount, txdata), NULL);
else
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionSignatureChecker(&tx, nIn, amount, amountPreviousInput, txdata), NULL);
return VerifyScript(tx.vin[nIn].scriptSig, CScript(scriptPubKey, scriptPubKey + scriptPubKeyLen), &tx.vin[nIn].scriptWitness, flags, TransactionSignatureChecker(&tx, nIn, amount, amountPreviousInput, txdata, CScript()), NULL);
} catch (const std::exception&) {
return set_error(err, bitcoinconsensus_ERR_TX_DESERIALIZE); // Error deserializing
}