Skip to content

Commit 0657a13

Browse files
committed
[Script] Treat overly long scriptPubKeys as unspendable
Backports bitcoin/bitcoin 4f87af6
1 parent 4bfc161 commit 0657a13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/script/script.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ class CScript : public std::vector<unsigned char>
618618
*/
619619
bool IsUnspendable() const
620620
{
621-
return (size() > 0 && *begin() == OP_RETURN);
621+
return (size() > 0 && *begin() == OP_RETURN) || (size() > MAX_SCRIPT_SIZE);
622622
}
623623

624624
std::string ToString() const;

0 commit comments

Comments
 (0)