Open bitbandi opened 2 years ago
We have a gRPC server for neutrino in version 0.15 of lnd, which IMO should actually be moved to this project, which'll allow us to easily add calls like this.
plesae I would like to work on this
Go ahead @Chinwendu20 !
I really do not think banning a peer does anything to it, it just disconnects it and puts it in database that is not even consulted when we want to reconnect to a peer. Please let me know if I am mistaken.
database that is not even consulted when we want to reconnect to a peer.
I dont think that is true. See all the calls to (*ChainService) IsBanned
I don't think IsBanned
has anything to do with reconnection?
https://github.com/lightninglabs/neutrino/blob/3275e33e5504daf33393ca8c888c8111a0595823/neutrino.go#L1102-L1124
im saying look at where IsBanned
is called from. There a a couple of call sites. We call this to check if we should connect to a peer or if we should disconnect from them if they connect to us
Oh thanks you are totally right. I was looking at the logs and it seemed we connect to already banned peers but after following the code after you pointed it out, it seems in some cases we let the peers connect then in onconnected function disconnect them.
If a peer is banned for (48hours) becase he does bad things. But somethimes bans are unfair (btc daemon misconfigure, etc). there is no possible to unban the fixed peer.
Please add some func for this. and for lnd/lncli rpc too.