Skip to content

Commit

Permalink
Fixes (#533)
Browse files Browse the repository at this point in the history
  • Loading branch information
fassadlr authored Apr 26, 2021
1 parent e59d807 commit 320b92a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public IActionResult GetBlock([FromQuery] SearchByHashRequest query)
if (this.network.Consensus.IsProofOfStake)
{
var posBlock = block as PosBlock;

blockModel.PosBlockSignature = posBlock.BlockSignature.ToHex(this.network);
blockModel.PosBlockTrust = new Target(chainedHeader.GetBlockTarget()).ToUInt256().ToString();
blockModel.PosChainTrust = chainedHeader.ChainWork.ToString(); // this should be similar to ChainWork
Expand All @@ -158,7 +158,7 @@ public IActionResult GetBlock([FromQuery] SearchByHashRequest query)

blockModel.PosModifierv2 = blockStake?.StakeModifierV2.ToString();
blockModel.PosFlags = blockStake?.Flags == BlockFlag.BLOCK_PROOF_OF_STAKE ? "proof-of-stake" : "proof-of-work";
blockModel.PosHashProof = blockStake?.HashProof.ToString();
blockModel.PosHashProof = blockStake?.HashProof?.ToString();
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/Stratis.Bitcoin/Builder/FullNodeFeatureExecutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ private void LogAndAddException(IFullNodeFeature feature, bool disposing, List<E
exceptions.Add(exception);

var messageText = disposing ? "disposing" : "starting";
var exceptionText = $"An error occurred {messageText} full node feature '{feature.GetType().Name}': '{exception}'";
var exceptionText = "An error occurred {0} full node feature '{1}' : '{2}'";

this.logger.Error(exceptionText);
this.signals.Publish(new FullNodeEvent() { Message = exceptionText, State = FullNodeState.Failed.ToString() });
this.logger.Error(exceptionText, messageText, feature.GetType().Name, exception);
this.signals.Publish(new FullNodeEvent() { Message = string.Format(exceptionText, messageText, feature.GetType().Name, exception.Message), State = FullNodeState.Failed.ToString() });
}
}
}

0 comments on commit 320b92a

Please sign in to comment.