swarm
swarm copied to clipboard
protocols, swap: drop unincentivized peers when sending/receiving messages
This PR changes the code in the sending and receiving messages functions so that peers are dropped when they are unincentivized (when the node running is not).
This can happen if the peer in question is registered in other protocols but not in SWAP.
The benefit of this change is to avoid useless message exchanges that are going to be dropped every time they accounting hook is called.
closes #1917
even though i still have to add a test for this, i am going to preliminary request reviews from @Eknir and @santicomp2014 as well