Auto merge of #2386 - str4d:2385-consensus-correction, r=str4d

Correct consensus logic in ContextualCheckInputs

Closes #2385.
This commit is contained in:
Homu
2017-06-15 18:50:03 -07:00
3 changed files with 68 additions and 3 deletions

View File

@@ -1687,11 +1687,12 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
bool ContextualCheckInputs(const CTransaction& tx, CValidationState &state, const CCoinsViewCache &inputs, bool fScriptChecks, unsigned int flags, bool cacheStore, const Consensus::Params& consensusParams, std::vector<CScriptCheck> *pvChecks)
{
if (!Consensus::CheckTxInputs(tx, state, inputs, GetSpendHeight(inputs), consensusParams))
return false;
if (!tx.IsCoinBase())
{
if (!Consensus::CheckTxInputs(tx, state, inputs, GetSpendHeight(inputs), consensusParams)) {
return false;
}
if (pvChecks)
pvChecks->reserve(tx.vin.size());