Improved hpfs initialisation error handling. (#104)

This commit is contained in:
Ravin Perera
2020-08-04 12:05:27 +05:30
committed by GitHub
parent 88ad472254
commit 1328b06346
2 changed files with 17 additions and 7 deletions

View File

@@ -210,12 +210,16 @@ namespace cons
if (ctx.stage == 3)
{
if (apply_ledger(stg_prop) == -1)
return -1;
// node has finished a consensus round (all 4 stages).
LOG_INFO << "****Stage 3 consensus reached**** (lcl:" << ctx.lcl.substr(0, 15)
<< " state:" << ctx.state << ")";
if (apply_ledger(stg_prop) != -1)
{
// node has finished a consensus round (all 4 stages).
LOG_INFO << "****Stage 3 consensus reached**** (lcl:" << ctx.lcl.substr(0, 15)
<< " state:" << ctx.state << ")";
}
else
{
LOG_ERR << "Error occured in Stage 3 consensus execution.";
}
}
}
}
@@ -775,7 +779,10 @@ namespace cons
// TODO: Do something usefull with HP<-->SC channel.
if (sc::execute_contract(ctx.contract_ctx) == -1)
{
LOG_ERR << "Contract execution failed.";
return -1;
}
ctx.state = args.post_execution_state_hash;
extract_user_outputs_from_contract_bufmap(args.userbufs);