diff options
author | Felix Lange <fjl@twurst.com> | 2018-02-17 03:16:23 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2018-02-17 04:29:20 +0800 |
commit | aeedec4078647c22244552803c88521391224ab1 (patch) | |
tree | 2cead3501991bb474f0a50727b625fea75700797 /p2p/discover/udp_test.go | |
parent | 32301a4d6b3a9684e954057e7cdb15998764122b (diff) | |
download | go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar.gz go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar.bz2 go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar.lz go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar.xz go-tangerine-aeedec4078647c22244552803c88521391224ab1.tar.zst go-tangerine-aeedec4078647c22244552803c88521391224ab1.zip |
p2p/discover: s/lastPong/bondTime/, update TestUDP_findnode
I forgot to change the check in udp.go when I changed Table.bond to be
based on lastPong instead of node presence in db. Rename lastPong to
bondTime and add hasBond so it's clearer what this DB key is used for
now.
Diffstat (limited to 'p2p/discover/udp_test.go')
-rw-r--r-- | p2p/discover/udp_test.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index 3ffa5c4dd..db9804f7b 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -247,12 +247,8 @@ func TestUDP_findnode(t *testing.T) { // ensure there's a bond with the test node, // findnode won't be accepted otherwise. - test.table.db.updateNode(NewNode( - PubkeyID(&test.remotekey.PublicKey), - test.remoteaddr.IP, - uint16(test.remoteaddr.Port), - 99, - )) + test.table.db.updateBondTime(PubkeyID(&test.remotekey.PublicKey), time.Now()) + // check that closest neighbors are returned. test.packetIn(nil, findnodePacket, &findnode{Target: testTarget, Expiration: futureExp}) expected := test.table.closest(targetHash, bucketSize) |