From 9868efd05f1afb60ce9f211a5b584c586503e108 Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Fri, 27 Mar 2020 16:18:53 +0530 Subject: [PATCH 1/2] fix memory store signed peer record bug --- pstoremem/addr_book.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pstoremem/addr_book.go b/pstoremem/addr_book.go index c0db4f5..b883902 100644 --- a/pstoremem/addr_book.go +++ b/pstoremem/addr_book.go @@ -252,7 +252,7 @@ func (mab *memoryAddrBook) addAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du // } // if we've expired all the signed addresses for a peer, remove their signed routing state record - if len(addrs) == 0 { + if len(amap) == 0 { delete(s.signedPeerRecords, p) } } From cdec762f400287e2dd04027a5ee70ccbf15628c7 Mon Sep 17 00:00:00 2001 From: Aarsh Shah Date: Sat, 28 Mar 2020 16:17:10 +0530 Subject: [PATCH 2/2] fix add addrs bug --- pstoremem/addr_book.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/pstoremem/addr_book.go b/pstoremem/addr_book.go index b883902..cb7340f 100644 --- a/pstoremem/addr_book.go +++ b/pstoremem/addr_book.go @@ -240,21 +240,6 @@ func (mab *memoryAddrBook) addAddrs(p peer.ID, addrs []ma.Multiaddr, ttl time.Du } } } - - // // when adding signed addrs, make sure only the addrs from the input list remain. - // if signed { - // for k := range amap { - // _, ok := addrSet[k] - // if !ok { - // delete(amap, k) - // } - // } - // } - - // if we've expired all the signed addresses for a peer, remove their signed routing state record - if len(amap) == 0 { - delete(s.signedPeerRecords, p) - } } // SetAddr calls mgr.SetAddrs(p, addr, ttl)