Skip to content

Commit

Permalink
plugins: remove expressions that are always true (#3393)
Browse files Browse the repository at this point in the history
* this expression is always true

* Improve

---------

Co-authored-by: Shargon <[email protected]>
  • Loading branch information
chenzhitong and shargon authored Jul 3, 2024
1 parent 5f66404 commit 96c9e77
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/Plugins/ApplicationLogs/LogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,11 @@ private void OnGetBlockCommand(string blockHashOrIndex, string eventName = null)
_neostore.GetBlockLog(blockhash, TriggerType.PostPersist) :
_neostore.GetBlockLog(blockhash, TriggerType.PostPersist, eventName);

if (blockOnPersist == null && blockOnPersist == null)
if (blockOnPersist == null)
ConsoleHelper.Error($"No logs.");
if (blockOnPersist != null)
PrintExecutionToConsole(blockOnPersist);
if (blockPostPersist != null)
else
{
PrintExecutionToConsole(blockOnPersist);
ConsoleHelper.Info("--------------------------------");
PrintExecutionToConsole(blockPostPersist);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Plugins/OracleService/OracleService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private bool CheckTxSign(DataCache snapshot, Transaction tx, ConcurrentDictionar
}
ECPoint[] oraclesNodes = NativeContract.RoleManagement.GetDesignatedByRole(snapshot, Role.Oracle, height);
int neededThreshold = oraclesNodes.Length - (oraclesNodes.Length - 1) / 3;
if (OracleSigns.Count >= neededThreshold && tx != null)
if (OracleSigns.Count >= neededThreshold)
{
var contract = Contract.CreateMultiSigContract(neededThreshold, oraclesNodes);
ScriptBuilder sb = new ScriptBuilder();
Expand Down

0 comments on commit 96c9e77

Please sign in to comment.