Skip to content

Commit

Permalink
add log when exception happens under debug mode (neo-project#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim8y committed Feb 8, 2022
1 parent 456c980 commit 7b661e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/DBFTPlugin/Consensus/ConsensusContext.MakePayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ private void SignPayload(ExtensiblePayload payload)
sc = new ContractParametersContext(neoSystem.StoreView, payload, dbftSettings.Network);
wallet.Sign(sc);
}
catch (InvalidOperationException)
catch (InvalidOperationException exception)
{
Utility.Log(nameof(ConsensusContext), LogLevel.Debug, exception.ToString());
return;
}
payload.Witness = sc.GetWitnesses()[0];
Expand Down
3 changes: 2 additions & 1 deletion src/DBFTPlugin/Consensus/ConsensusContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ public bool Load()
{
Deserialize(reader);
}
catch
catch (Exception exception)
{
Utility.Log(nameof(ConsensusContext), LogLevel.Debug, exception.ToString());
return false;
}
return true;
Expand Down
8 changes: 3 additions & 5 deletions src/DBFTPlugin/Consensus/ConsensusService.OnMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ private void OnConsensusPayload(ExtensiblePayload payload)
{
message = context.GetMessage(payload);
}
catch (FormatException)
{
return;
}
catch (IOException)
catch (Exception ex)
{
Utility.Log(nameof(ConsensusService), LogLevel.Debug, ex.ToString());
return;
}

if (!message.Verify(neoSystem.Settings)) return;
if (message.BlockIndex != context.Block.Index)
{
Expand Down

0 comments on commit 7b661e5

Please sign in to comment.