@@ -22,17 +22,21 @@ BOOST_AUTO_TEST_CASE(RegisterPeerTest)
2222 BOOST_CHECK (tracker.RegisterPeer (/* peer_id=*/ 0 , /* is_peer_inbound=*/ true ,
2323 /* peer_recon_version=*/ 0 , salt) == ReconciliationRegisterResult::PROTOCOL_VIOLATION);
2424
25- // Valid registration.
25+ // Valid registration (inbound and outbound peers) .
2626 BOOST_REQUIRE (!tracker.IsPeerRegistered (0 ));
2727 BOOST_REQUIRE (tracker.RegisterPeer (0 , true , 1 , salt) == ReconciliationRegisterResult::SUCCESS);
2828 BOOST_CHECK (tracker.IsPeerRegistered (0 ));
29-
30- // Reconciliation version is higher than ours, should be able to register.
3129 BOOST_REQUIRE (!tracker.IsPeerRegistered (1 ));
3230 tracker.PreRegisterPeer (1 );
33- BOOST_REQUIRE (tracker.RegisterPeer (1 , true , 2 , salt) == ReconciliationRegisterResult::SUCCESS);
31+ BOOST_REQUIRE (tracker.RegisterPeer (1 , false , 1 , salt) == ReconciliationRegisterResult::SUCCESS);
3432 BOOST_CHECK (tracker.IsPeerRegistered (1 ));
3533
34+ // Reconciliation version is higher than ours, should be able to register.
35+ BOOST_REQUIRE (!tracker.IsPeerRegistered (2 ));
36+ tracker.PreRegisterPeer (2 );
37+ BOOST_REQUIRE (tracker.RegisterPeer (2 , true , 2 , salt) == ReconciliationRegisterResult::SUCCESS);
38+ BOOST_CHECK (tracker.IsPeerRegistered (2 ));
39+
3640 // Try registering for the second time.
3741 BOOST_REQUIRE (tracker.RegisterPeer (1 , false , 1 , salt) == ReconciliationRegisterResult::ALREADY_REGISTERED);
3842
0 commit comments