massa
massa copied to clipboard
Change wishlist of consensus to a shared state
Context
Currently, when consensus want new blocks or doesn't some blocks it sends a message to protocol to update the block wishlist.
This could cause problems in case of protocol isn't ready to receive the changes message (problems while listening, disconnected) and also introduce a important connection Consensus -> Protocol
that could cause contention because there is already a connection Protocol -> Consensus
for blocks received from the network.
Solution
Change the wishlist from a channel message pass to a RwLock that will be poll by the Protocol. We could also add a CondVar that is notify when there is a change.