dimxy / komodo

Komodo
https://komodoplatform.com/
Other
7 stars 4 forks source link

cc signature checked twice in AcceptToMemoryPool #111

Open dimxy opened 2 years ago

dimxy commented 2 years ago

Cryptoconditions signature is checked twice in AcceptToMemoryPool() Here:

if (!ContextualCheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true, txdata, Params().GetConsensus(), consensusBranchId, evalcodeChecker))

and here:

 if (!ContextualCheckInputs(tx, state, view, true, MANDATORY_SCRIPT_VERIFY_FLAGS, true, txdata, Params().GetConsensus(), consensusBranchId, evalcodeChecker))

I think it was supposed it is checked only at the call when STANDARD_SCRIPT_VERIFY_FLAGS is set when non-cc sigs are checked too. Fix this to avoid extra processing