Bugfix: Move IsStandard scriptSig size check out of IsPushOnly, since BIP16 verificat...
authorLuke Dashjr <luke-jr+git@utopios.org>
Tue, 12 Jun 2012 23:50:38 +0000 (23:50 +0000)
committerLuke Dashjr <luke-jr+git@utopios.org>
Tue, 12 Jun 2012 23:50:38 +0000 (23:50 +0000)
This caused clients to reject block #177618 since it has a P2SH transaction with over 200 bytes in scriptSig.

(Upstream commit: e679ec969c8b22c676ebb10bea1038f6c8f13b33)

src/main.h
src/script.h

index 44624f5..930f518 100644 (file)
@@ -507,7 +507,7 @@ public:
     bool IsStandard() const
     {
         BOOST_FOREACH(const CTxIn& txin, vin)
-            if (!txin.scriptSig.IsPushOnly())
+            if (txin.scriptSig.size() > 200 || !txin.scriptSig.IsPushOnly())
                 return error("nonstandard txin: %s", txin.scriptSig.ToString().c_str());
         BOOST_FOREACH(const CTxOut& txout, vout)
             if (!::IsStandard(txout.scriptPubKey))
index 502bce1..8dddb89 100644 (file)
@@ -623,8 +623,6 @@ public:
 
     bool IsPushOnly() const
     {
-        if (size() > 200)
-            return false;
         const_iterator pc = begin();
         while (pc < end())
         {