lightninglabs / neutrino

Privacy-Preserving Bitcoin Light Client
MIT License
894 stars 182 forks source link

unban peer #253

Open bitbandi opened 2 years ago

bitbandi commented 2 years ago

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.

Roasbeef commented 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.

Chinwendu20 commented 1 year ago

plesae I would like to work on this

lucasdcf commented 1 year ago

Go ahead @Chinwendu20 !

Chinwendu20 commented 2 months ago

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.

ellemouton commented 2 months ago

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

Chinwendu20 commented 2 months ago

I don't think IsBanned has anything to do with reconnection? https://github.com/lightninglabs/neutrino/blob/3275e33e5504daf33393ca8c888c8111a0595823/neutrino.go#L1102-L1124

ellemouton commented 2 months ago

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

Chinwendu20 commented 2 months ago

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.