@@ -167,17 +167,23 @@ BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, TestChain100Setup)
167
167
LOCK (cs_main);
168
168
tip = ::ChainActive ().Tip ();
169
169
}
170
- CScript coinbase_script_pub_key = GetScriptForDestination (PKHash (coinbaseKey.GetPubKey ()));
170
+ CKey coinbase_key_A, coinbase_key_B;
171
+ coinbase_key_A.MakeNewKey (true );
172
+ coinbase_key_B.MakeNewKey (true );
173
+ CScript coinbase_script_pub_key_A = GetScriptForDestination (PKHash (coinbase_key_A.GetPubKey ()));
174
+ CScript coinbase_script_pub_key_B = GetScriptForDestination (PKHash (coinbase_key_B.GetPubKey ()));
171
175
std::vector<std::shared_ptr<CBlock>> chainA, chainB;
172
- BOOST_REQUIRE (BuildChain (tip, coinbase_script_pub_key , 10 , chainA));
173
- BOOST_REQUIRE (BuildChain (tip, coinbase_script_pub_key , 10 , chainB));
176
+ BOOST_REQUIRE (BuildChain (tip, coinbase_script_pub_key_A , 10 , chainA));
177
+ BOOST_REQUIRE (BuildChain (tip, coinbase_script_pub_key_B , 10 , chainB));
174
178
175
179
// Check that new blocks on chain A get indexed.
176
180
uint256 chainA_last_header = last_header;
177
181
for (size_t i = 0 ; i < 2 ; i++) {
178
182
const auto & block = chainA[i];
179
183
BOOST_REQUIRE (ProcessNewBlock (Params (), block, true , nullptr ));
180
-
184
+ }
185
+ for (size_t i = 0 ; i < 2 ; i++) {
186
+ const auto & block = chainA[i];
181
187
const CBlockIndex* block_index;
182
188
{
183
189
LOCK (cs_main);
@@ -193,7 +199,9 @@ BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, TestChain100Setup)
193
199
for (size_t i = 0 ; i < 3 ; i++) {
194
200
const auto & block = chainB[i];
195
201
BOOST_REQUIRE (ProcessNewBlock (Params (), block, true , nullptr ));
196
-
202
+ }
203
+ for (size_t i = 0 ; i < 3 ; i++) {
204
+ const auto & block = chainB[i];
197
205
const CBlockIndex* block_index;
198
206
{
199
207
LOCK (cs_main);
@@ -221,7 +229,7 @@ BOOST_FIXTURE_TEST_CASE(blockfilter_index_initial_sync, TestChain100Setup)
221
229
// Reorg back to chain A.
222
230
for (size_t i = 2 ; i < 4 ; i++) {
223
231
const auto & block = chainA[i];
224
- BOOST_REQUIRE (ProcessNewBlock (Params (), block, true , nullptr ));
232
+ BOOST_REQUIRE (ProcessNewBlock (Params (), block, true , nullptr ));
225
233
}
226
234
227
235
// Check that chain A and B blocks can be retrieved.
0 commit comments