From a9306587a42eac7fb889b9c8d03140980fdf1398 Mon Sep 17 00:00:00 2001 From: Flavien Charlon Date: Fri, 14 Nov 2014 10:20:58 +0000 Subject: [PATCH 1/2] Change the default maximum OP_RETURN size to 80 bytes The value can be changed through the '-datacarriersize' option, this is modifying the default value for that option. --- src/script/standard.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/script/standard.h b/src/script/standard.h index f3dcc75fdc82b..f4446b0fe4317 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -25,7 +25,7 @@ class CScriptID : public uint160 CScriptID(const uint160& in) : uint160(in) {} }; -static const unsigned int MAX_OP_RETURN_RELAY = 40; //! bytes +static const unsigned int MAX_OP_RETURN_RELAY = 80; //! bytes extern unsigned nMaxDatacarrierBytes; /** From 44e9a6b22e472971aebf647f4386fb5a4436a0e3 Mon Sep 17 00:00:00 2001 From: Flavien Charlon Date: Sun, 16 Nov 2014 15:43:12 +0000 Subject: [PATCH 2/2] Update the 'test_IsStandard' unit test The maximum length for the payload of an OP_RETURN output is now 80 bytes, and unit tests must be modified to account for the change. --- src/test/transaction_tests.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index d4c9b1a0ea072..dab2249f25fa0 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -342,12 +342,12 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) t.vout[0].scriptPubKey = CScript() << OP_1; BOOST_CHECK(!IsStandardTx(t, reason)); - // 40-byte TX_NULL_DATA (standard) - t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38"); + // 80-byte TX_NULL_DATA (standard) + t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38"); BOOST_CHECK(IsStandardTx(t, reason)); - // 41-byte TX_NULL_DATA (non-standard) - t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800"); + // 81-byte TX_NULL_DATA (non-standard) + t.vout[0].scriptPubKey = CScript() << OP_RETURN << ParseHex("04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3804678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef3800"); BOOST_CHECK(!IsStandardTx(t, reason)); // TX_NULL_DATA w/o PUSHDATA