Refactored consensus to run on a separate thread. (#123)

This commit is contained in:
Savinda Senevirathne
2020-09-18 15:53:15 +05:30
committed by GitHub
parent 180b1ec714
commit 37629471c5
4 changed files with 164 additions and 133 deletions

View File

@@ -153,9 +153,8 @@ namespace p2p
{
if (ctx.peer_connections.size() == 0)
{
LOG_DBG << "No peers to broadcast (not even self). Waiting until at least one peer connects.";
while (ctx.peer_connections.size() == 0)
util::sleep(100);
LOG_DBG << "No peers to broadcast (not even self). Cannot broadcast.";
return;
}
//Broadcast while locking the peer_connections.