File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -46,18 +46,6 @@ class AddrManTest : public AddrMan
46
46
LOCK (m_impl->cs );
47
47
m_impl->Delete (nId);
48
48
}
49
-
50
- // Simulates connection failure so that we can test eviction of offline nodes
51
- void SimConnFail (const CService& addr)
52
- {
53
- int64_t nLastSuccess = 1 ;
54
- // Set last good connection in the deep past.
55
- Good (addr, nLastSuccess);
56
-
57
- bool count_failure = false ;
58
- int64_t nLastTry = GetAdjustedTime () - 61 ;
59
- Attempt (addr, count_failure, nLastTry);
60
- }
61
49
};
62
50
63
51
static CNetAddr ResolveIP (const std::string& ip)
@@ -897,7 +885,9 @@ BOOST_AUTO_TEST_CASE(addrman_evictionworks)
897
885
BOOST_CHECK_EQUAL (info.ToString (), " 250.1.1.19:0" );
898
886
899
887
// Ensure test of address fails, so that it is evicted.
900
- addrman.SimConnFail (info);
888
+ // Update entry in tried by setting last good connection in the deep past.
889
+ BOOST_CHECK (!addrman.Good (info, /* nTime=*/ 1 ));
890
+ addrman.Attempt (info, /* fCountFailure=*/ false , /* nTime=*/ GetAdjustedTime () - 61 );
901
891
902
892
// Should swap 36 for 19.
903
893
addrman.ResolveCollisions ();
You can’t perform that action at this time.
0 commit comments