HelloZeroNet / Plugin-PeerMessage

26 stars 12 forks source link

Peer(in)valid timeout #10

Closed krzysztof113 closed 4 years ago

krzysztof113 commented 4 years ago

Hi

Can Peer validity messages be sent with delay? I plan to use it to ban bad peers but decision may not come instantly. What's the timeout and are broadcasts cached until peerValid sent?

purplesyringa commented 4 years ago

Messages are queued until you send peerValid/peerInvalid without timeout so you can spend as much time as you want. Please notice that there's no way to detect that the browser was closed so in case it happens while you're verifying messages, they will be lost.

krzysztof113 commented 4 years ago

Is there a problem like for example performance when PeerValid is not sent on purpose, in my case when message is consumed and doesn't have to be broadcast further?

purplesyringa commented 4 years ago

You might want to use peerInvalid e.g. in blockchain if the signature/hash/whatever don't match.