kaspanet / kaspad

Kaspad was the reference full node Kaspa implementation written in Go (golang), now rewritten in Rust: https://github.com/kaspanet/rusty-kaspa
ISC License
457 stars 231 forks source link

Don't return banned peers when asking for an address #1122

Open elichai opened 3 years ago

ev3649 commented 2 years ago

Wanted to try out my new go skills and looking for an issue. How can the issue be reproduced?
From looking at the code seems like getRandomAddress returns unbanned address + already connected ones, while isBanned check ignores already connected one, could this be the cause of the issue?
Is there any way of banning addresses except for the using kaspactl?

someone235 commented 2 years ago

Just looked at AddressManager.RandomAddress. Looks like this issue is already addressed

svarogg commented 2 years ago
2021-11-14 12:14:35.198 [INF] CMGR: Connecting to 135.181.223.100:16111
2021-11-14 12:14:35.382 [INF] TXMP: P2P Connected to 135.181.223.100:16111
2021-11-14 12:14:35.382 [INF] PROT: Peer <<nil>: 135.181.223.100:16111> is banned. Disconnecting...

^ This happened after the last change in address manager, so probably still happening, but might be quite an edge case, and as such probably better to remove the "good first task" label.

@someone235 What you think?