diff --git a/src/Plugins/DBFTPlugin/Consensus/ConsensusContext.cs b/src/Plugins/DBFTPlugin/Consensus/ConsensusContext.cs index 2e6a3a19a6..d6a4340544 100644 --- a/src/Plugins/DBFTPlugin/Consensus/ConsensusContext.cs +++ b/src/Plugins/DBFTPlugin/Consensus/ConsensusContext.cs @@ -116,7 +116,9 @@ public ConsensusContext(NeoSystem neoSystem, Settings settings, Wallet wallet) this.wallet = wallet; this.neoSystem = neoSystem; dbftSettings = settings; - store = neoSystem.LoadStore(settings.RecoveryLogs); + + if (dbftSettings.IgnoreRecoveryLogs == false) + store = neoSystem.LoadStore(settings.RecoveryLogs); } public Block CreateBlock() @@ -168,7 +170,7 @@ public Block EnsureHeader() public bool Load() { - byte[] data = store.TryGet(ConsensusStateKey); + byte[] data = store?.TryGet(ConsensusStateKey); if (data is null || data.Length == 0) return false; MemoryReader reader = new(data); try @@ -272,7 +274,7 @@ public void Reset(byte viewNumber) public void Save() { - store.PutSync(ConsensusStateKey, this.ToArray()); + store?.PutSync(ConsensusStateKey, this.ToArray()); } public void Deserialize(ref MemoryReader reader)