Skip to content

Commit

Permalink
chore: saving agent and protoVersion in peerStore (#2860)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmer authored Jul 1, 2024
1 parent 31c632e commit cae0c7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/node/test_wakunode_peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ suite "Peer Manager":
await server2.stop()

suite "Tracked Peer Metadata":
xasyncTest "Metadata Recording":
asyncTest "Metadata Recording":
# When adding a peer other than self to the peer store
serverRemotePeerInfo.enr = some(server.enr)
client.peerManager.addPeer(serverRemotePeerInfo)
Expand Down
2 changes: 2 additions & 0 deletions waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ proc addPeer*(pm: PeerManager, remotePeerInfo: RemotePeerInfo, origin = UnknownO
pm.peerStore[AddressBook][remotePeerInfo.peerId] = remotePeerInfo.addrs
pm.peerStore[KeyBook][remotePeerInfo.peerId] = remotePeerInfo.publicKey
pm.peerStore[SourceBook][remotePeerInfo.peerId] = origin
pm.peerStore[ProtoVersionBook][remotePeerInfo.peerId] = remotePeerInfo.protoVersion
pm.peerStore[AgentBook][remotePeerInfo.peerId] = remotePeerInfo.agent

if remotePeerInfo.protocols.len > 0:
pm.peerStore[ProtoBook][remotePeerInfo.peerId] = remotePeerInfo.protocols
Expand Down

0 comments on commit cae0c7e

Please sign in to comment.