jcomeau_ictx

policy.cpp.patch

Jan 27th, 2018
92
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
  2. index ae42b2bd7..038ae6693 100644
  3. --- a/src/policy/policy.cpp
  4. +++ b/src/policy/policy.cpp
  5. @@ -133,19 +133,26 @@ bool AreInputsStandard(const CTransaction& tx, const CCoinsViewCache& mapInputs)
  6. txnouttype whichType;
  7. // get the scriptPubKey corresponding to this input:
  8. const CScript& prevScript = prev.scriptPubKey;
  9. - if (!Solver(prevScript, whichType, vSolutions))
  10. + if (!Solver(prevScript, whichType, vSolutions)) {
  11. + LogPrintf("AreInputsStandard fails at prev.scriptPubKey at input %d: %s\n", i, HexStr(prev.scriptPubKey));
  12. return false;
  13. + }
  14.  
  15. if (whichType == TX_SCRIPTHASH)
  16. {
  17. std::vector<std::vector<unsigned char> > stack;
  18. // convert the scriptSig into a stack, so we can inspect the redeemScript
  19. - if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), SIGVERSION_BASE))
  20. + if (!EvalScript(stack, tx.vin[i].scriptSig, SCRIPT_VERIFY_NONE, BaseSignatureChecker(), SIGVERSION_BASE)) {
  21. + LogPrintf("AreInputsStandard fails at EvalScript(stack, tx.vin[%d].scriptSig)\n", i);
  22. return false;
  23. - if (stack.empty())
  24. + }
  25. + if (stack.empty()) {
  26. + LogPrintf("AreInputsStandard fails at stack empty at index %d\n", i);
  27. return false;
  28. + }
  29. CScript subscript(stack.back().begin(), stack.back().end());
  30. if (subscript.GetSigOpCount(true) > MAX_P2SH_SIGOPS) {
  31. + LogPrintf("AreInputsStandard fails at MAX_P2SH_SIGOPS at index %d\n", i);
  32. return false;
  33. }
  34. }
RAW Paste Data