mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Check for canonical public keys and signatures
Only enabled inside tests for now.
This commit is contained in:
parent
bfc24bd4ce
commit
58bc86e37f
12 changed files with 245 additions and 62 deletions
|
|
@ -327,7 +327,7 @@ bool CTransaction::AreInputsStandard(const MapPrevTx& mapInputs) const
|
|||
// beside "push data" in the scriptSig the
|
||||
// IsStandard() call returns false
|
||||
vector<vector<unsigned char> > stack;
|
||||
if (!EvalScript(stack, vin[i].scriptSig, *this, i, 0))
|
||||
if (!EvalScript(stack, vin[i].scriptSig, *this, i, false, 0))
|
||||
return false;
|
||||
|
||||
if (whichType == TX_SCRIPTHASH)
|
||||
|
|
@ -1292,11 +1292,11 @@ bool CTransaction::ConnectInputs(MapPrevTx inputs,
|
|||
if (!(fBlock && (nBestHeight < Checkpoints::GetTotalBlocksEstimate())))
|
||||
{
|
||||
// Verify signature
|
||||
if (!VerifySignature(txPrev, *this, i, fStrictPayToScriptHash, 0))
|
||||
if (!VerifySignature(txPrev, *this, i, fStrictPayToScriptHash, false, 0))
|
||||
{
|
||||
// only during transition phase for P2SH: do not invoke anti-DoS code for
|
||||
// potentially old clients relaying bad P2SH transactions
|
||||
if (fStrictPayToScriptHash && VerifySignature(txPrev, *this, i, false, 0))
|
||||
if (fStrictPayToScriptHash && VerifySignature(txPrev, *this, i, false, false, 0))
|
||||
return error("ConnectInputs() : %s P2SH VerifySignature failed", GetHash().ToString().substr(0,10).c_str());
|
||||
|
||||
return DoS(100,error("ConnectInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str()));
|
||||
|
|
@ -1350,7 +1350,7 @@ bool CTransaction::ClientConnectInputs()
|
|||
return false;
|
||||
|
||||
// Verify signature
|
||||
if (!VerifySignature(txPrev, *this, i, true, 0))
|
||||
if (!VerifySignature(txPrev, *this, i, true, false, 0))
|
||||
return error("ConnectInputs() : VerifySignature failed");
|
||||
|
||||
///// this is redundant with the mempool.mapNextTx stuff,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue