relax restrictions on AcceptableInputs

This commit is contained in:
UdjinM6 2015-04-05 22:37:15 +03:00
parent d5f7a89097
commit 8bd7e1d181

View File

@ -1176,10 +1176,11 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
// Rather not work on nonstandard transactions (unless -testnet/-regtest) // Rather not work on nonstandard transactions (unless -testnet/-regtest)
string reason; string reason;
if (Params().RequireStandard() && !IsStandardTx(tx, reason)) // for any real tx this will be checked on AcceptToMemoryPool anyway
return state.DoS(0, // if (Params().RequireStandard() && !IsStandardTx(tx, reason))
error("AcceptableInputs : nonstandard transaction: %s", reason), // return state.DoS(0,
REJECT_NONSTANDARD, reason); // error("AcceptableInputs : nonstandard transaction: %s", reason),
// REJECT_NONSTANDARD, reason);
// is it already in the memory pool? // is it already in the memory pool?
uint256 hash = tx.GetHash(); uint256 hash = tx.GetHash();
@ -1253,8 +1254,9 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
} }
// Check for non-standard pay-to-script-hash in inputs // Check for non-standard pay-to-script-hash in inputs
if (Params().RequireStandard() && !AreInputsStandard(tx, view)) // for any real tx this will be checked on AcceptToMemoryPool anyway
return error("AcceptableInputs: : nonstandard transaction input"); // if (Params().RequireStandard() && !AreInputsStandard(tx, view))
// return error("AcceptableInputs: : nonstandard transaction input");
// Check that the transaction doesn't have an excessive number of // Check that the transaction doesn't have an excessive number of
// sigops, making it impossible to mine. Since the coinbase transaction // sigops, making it impossible to mine. Since the coinbase transaction
@ -1335,6 +1337,7 @@ bool AcceptableInputs(CTxMemPool& pool, CValidationState &state, const CTransact
// There is a similar check in CreateNewBlock() to prevent creating // There is a similar check in CreateNewBlock() to prevent creating
// invalid blocks, however allowing such transactions into the mempool // invalid blocks, however allowing such transactions into the mempool
// can be exploited as a DoS attack. // can be exploited as a DoS attack.
// for any real tx this will be checked on AcceptToMemoryPool anyway
// if (!CheckInputs(tx, state, view, false, MANDATORY_SCRIPT_VERIFY_FLAGS, true)) // if (!CheckInputs(tx, state, view, false, MANDATORY_SCRIPT_VERIFY_FLAGS, true))
// { // {
// return error("AcceptableInputs: : BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags %s", hash.ToString()); // return error("AcceptableInputs: : BUG! PLEASE REPORT THIS! ConnectInputs failed against MANDATORY but not STANDARD flags %s", hash.ToString());