@@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE(gcsfilter_default_constructor)
54
54
55
55
BOOST_AUTO_TEST_CASE (blockfilter_basic_test)
56
56
{
57
- CScript included_scripts[5 ], excluded_scripts[3 ];
57
+ CScript included_scripts[5 ], excluded_scripts[4 ];
58
58
59
59
// First two are outputs on a single transaction.
60
60
included_scripts[0 ] << std::vector<unsigned char >(0 , 65 ) << OP_CHECKSIG;
@@ -73,14 +73,19 @@ BOOST_AUTO_TEST_CASE(blockfilter_basic_test)
73
73
// This script is not related to the block at all.
74
74
excluded_scripts[1 ] << std::vector<unsigned char >(5 , 33 ) << OP_CHECKSIG;
75
75
76
+ // OP_RETURN is non-standard since it's not followed by a data push, but is still excluded from
77
+ // filter.
78
+ excluded_scripts[2 ] << OP_RETURN << OP_4 << OP_ADD << OP_8 << OP_EQUAL;
79
+
76
80
CMutableTransaction tx_1;
77
81
tx_1.vout .emplace_back (100 , included_scripts[0 ]);
78
82
tx_1.vout .emplace_back (200 , included_scripts[1 ]);
83
+ tx_1.vout .emplace_back (0 , excluded_scripts[0 ]);
79
84
80
85
CMutableTransaction tx_2;
81
86
tx_2.vout .emplace_back (300 , included_scripts[2 ]);
82
- tx_2.vout .emplace_back (0 , excluded_scripts[0 ]);
83
- tx_2.vout .emplace_back (400 , excluded_scripts[2 ]); // Script is empty
87
+ tx_2.vout .emplace_back (0 , excluded_scripts[2 ]);
88
+ tx_2.vout .emplace_back (400 , excluded_scripts[3 ]); // Script is empty
84
89
85
90
CBlock block;
86
91
block.vtx .push_back (MakeTransactionRef (tx_1));
@@ -90,7 +95,7 @@ BOOST_AUTO_TEST_CASE(blockfilter_basic_test)
90
95
block_undo.vtxundo .emplace_back ();
91
96
block_undo.vtxundo .back ().vprevout .emplace_back (CTxOut (500 , included_scripts[3 ]), 1000 , true );
92
97
block_undo.vtxundo .back ().vprevout .emplace_back (CTxOut (600 , included_scripts[4 ]), 10000 , false );
93
- block_undo.vtxundo .back ().vprevout .emplace_back (CTxOut (700 , excluded_scripts[2 ]), 100000 , false );
98
+ block_undo.vtxundo .back ().vprevout .emplace_back (CTxOut (700 , excluded_scripts[3 ]), 100000 , false );
94
99
95
100
BlockFilter block_filter (BlockFilterType::BASIC, block, block_undo);
96
101
const GCSFilter& filter = block_filter.GetFilter ();
0 commit comments