zjubfd
5a25b75b1d
p2p: refactor GetSelectionWithBias for addressbook (#3475)
Why submit this pr: we have suffered from infinite loop in addrbook bug which takes us a long time to find out why process become a zombie peer. It have been fixed in #3232. But the ADDRS_LOOP is still there, risk of infinite loop is still exist. The algorithm that to random pick a bucket is not stable, which means the peer may unluckily always choose the wrong bucket for a long time, the time and cpu cost is meaningless. A simple improvement: shuffle bucketsNew and bucketsOld, and pick necessary number of address from them. A stable algorithm. |
6 years ago | |
---|---|---|
.. | ||
addrbook.go | p2p: refactor GetSelectionWithBias for addressbook (#3475) | 6 years ago |
addrbook_test.go | p2p: refactor GetSelectionWithBias for addressbook (#3475) | 6 years ago |
errors.go | p2p: AddressBook requires addresses to have IDs; Do not close conn immediately after sending pex addrs in seed mode (#2797) | 6 years ago |
file.go | libs: Remove usage of custom Fmt, in favor of fmt.Sprintf (#2199) | 6 years ago |
known_address.go | p2p/pex: some addrbook fixes | 7 years ago |
params.go | fix build and test | 7 years ago |
pex_reactor.go | preallocating memory when we can | 6 years ago |
pex_reactor_test.go | fix FlushStop (#3247) | 6 years ago |
wire.go | alias amino imports (#3219) | 6 years ago |