Skip to content

Commit

Permalink
Merge branch 'master' into storage-abstract
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Nov 26, 2019
2 parents c29c65e + 84d6190 commit 434810e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
5 changes: 2 additions & 3 deletions src/neo/Ledger/Blockchain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class FillCompleted { }
Transactions = new[] { DeployNativeContracts() }
};

private readonly static byte[] onPersistNativeContractScript;
private readonly static Script onPersistNativeContractScript;
private const int MaxTxToReverifyPerIdle = 10;
private static readonly object lockObj = new object();
private readonly NeoSystem system;
Expand Down Expand Up @@ -325,8 +325,7 @@ private RelayResultReason OnNewBlock(Block block)
using (SnapshotView snapshot = GetSnapshot())
{
snapshot.Blocks.Add(block.Hash, block.Header.Trim());
snapshot.HeaderHashIndex.GetAndChange().Hash = block.Hash;
snapshot.HeaderHashIndex.GetAndChange().Index = block.Index;
snapshot.HeaderHashIndex.GetAndChange().Set(block);
SaveHeaderHashList(snapshot);
snapshot.Commit();
}
Expand Down
2 changes: 0 additions & 2 deletions src/neo/Network/P2P/Payloads/Header.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Neo.IO.Json;
using Neo.Ledger;
using Neo.Wallets;
using System;
using System.IO;
using System.Linq;

namespace Neo.Network.P2P.Payloads
{
Expand Down
4 changes: 2 additions & 2 deletions src/neo/SmartContract/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ internal static bool VerifyWitnesses(this IVerifiable verifiable, StoreView snap
{
engine.LoadScript(verification);
engine.LoadScript(verifiable.Witnesses[i].InvocationScript);
if (engine.Execute().HasFlag(VMState.FAULT)) return false;
if (engine.ResultStack.Count != 1 || !engine.ResultStack.Pop().ToBoolean()) return false;
if (engine.Execute() == VMState.FAULT) return false;
if (!engine.ResultStack.TryPop(out var result) || !result.ToBoolean()) return false;
}
}
return true;
Expand Down

0 comments on commit 434810e

Please sign in to comment.