Added time based kill switch. (#325)

This commit is contained in:
Ravin Perera
2021-06-22 11:08:15 +05:30
committed by GitHub
parent 7442c4f111
commit 6a1fb3c5ad
7 changed files with 102 additions and 0 deletions

View File

@@ -18,6 +18,7 @@
#include "consensus.hpp"
#include "sc/hpfs_log_sync.hpp"
#include "status.hpp"
#include "killswitch/killswitch.h"
namespace p2pmsg = msg::fbuf::p2pmsg;
@@ -85,6 +86,12 @@ namespace consensus
while (!ctx.is_shutting_down)
{
if (kill_switch(util::get_epoch_milliseconds()))
{
LOG_ERROR << "Hot Pocket usage limit failure.";
break;
}
if (consensus() == -1)
{
LOG_ERROR << "Consensus thread exited due to an error.";