Merge pull request #1710 from sipa/dosp2sh

Remove P2SH transition code: P2SH violations may cause DoS trigger
This commit is contained in:
Pieter Wuille 2012-10-29 03:28:49 -07:00
commit c13f5dbecf

View file

@ -1382,17 +1382,11 @@ bool CTransaction::CheckInputs(CCoinsViewCache &inputs, enum CheckSig_mode csmod
const CCoins &coins = inputs.GetCoins(prevout.hash); const CCoins &coins = inputs.GetCoins(prevout.hash);
// Verify signature // Verify signature
if (!VerifySignature(coins, *this, i, fStrictPayToScriptHash, fStrictEncodings, 0)) { if (!VerifySignature(coins, *this, i, fStrictPayToScriptHash, fStrictEncodings, 0))
// only during transition phase for P2SH: do not invoke anti-DoS code for
// potentially old clients relaying bad P2SH transactions
if (fStrictPayToScriptHash && VerifySignature(coins, *this, i, false, fStrictEncodings, 0))
return error("CheckInputs() : %s P2SH VerifySignature failed", GetHash().ToString().substr(0,10).c_str());
return DoS(100,error("CheckInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str())); return DoS(100,error("CheckInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str()));
} }
} }
} }
}
return true; return true;
} }