File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1357,11 +1357,19 @@ BOOST_AUTO_TEST_CASE(v2transport_test)
1357
1357
BOOST_CHECK (!(*ret)[1 ]);
1358
1358
BOOST_CHECK ((*ret)[2 ] && (*ret)[2 ]->m_type == " tx" && Span{(*ret)[2 ]->m_recv } == MakeByteSpan (msg_data_2));
1359
1359
1360
- // Then send a message with a bit error, expecting failure.
1360
+ // Then send a message with a bit error, expecting failure. It's possible this failure does
1361
+ // not occur immediately (when the length descriptor was modified), but it should come
1362
+ // eventually, and no messages can be delivered anymore.
1361
1363
tester.SendMessage (" bad" , msg_data_1);
1362
1364
tester.Damage ();
1363
- ret = tester.Interact ();
1364
- BOOST_CHECK (!ret);
1365
+ while (true ) {
1366
+ ret = tester.Interact ();
1367
+ if (!ret) break ; // failure
1368
+ BOOST_CHECK (ret->size () == 0 ); // no message can be delivered
1369
+ // Send another message.
1370
+ auto msg_data_3 = g_insecure_rand_ctx.randbytes <uint8_t >(InsecureRandRange (10000 ));
1371
+ tester.SendMessage (uint8_t (12 ), msg_data_3); // getheaders short id
1372
+ }
1365
1373
}
1366
1374
1367
1375
// Normal scenario, with a transport in responder node.
You can’t perform that action at this time.
0 commit comments