File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1958,3 +1958,27 @@ func TestInvalidKeys(t *testing.T) {
19581958 t .Fatal ("expected to have failed" )
19591959 }
19601960}
1961+
1962+ func TestRoutingFilter (t * testing.T ) {
1963+ ctx , cancel := context .WithCancel (context .Background ())
1964+ defer cancel ()
1965+
1966+ nDHTs := 2
1967+ dhts := setupDHTS (t , ctx , nDHTs )
1968+ defer func () {
1969+ for i := 0 ; i < nDHTs ; i ++ {
1970+ dhts [i ].Close ()
1971+ defer dhts [i ].host .Close ()
1972+ }
1973+ }()
1974+ dhts [0 ].routingTablePeerFilter = PublicRoutingTableFilter
1975+
1976+ connectNoSync (t , ctx , dhts [0 ], dhts [1 ])
1977+ wait (t , ctx , dhts [1 ], dhts [0 ])
1978+
1979+ select {
1980+ case <- ctx .Done ():
1981+ t .Fatal (ctx .Err ())
1982+ case <- time .After (time .Millisecond * 200 ):
1983+ }
1984+ }
You can’t perform that action at this time.
0 commit comments