From 30006a2e79fb184cd5fad14797a42f6a36bf7a29 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Thu, 18 May 2017 13:21:00 +1200 Subject: [PATCH] Correct consensus logic in ContextualCheckInputs Closes #2385. --- src/main.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index a3de5e6d7..6d8acde0c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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 *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());