From a4f135d3272dd30be02e3374e7a7dc03e92bd757 Mon Sep 17 00:00:00 2001 From: Erik Zhang Date: Mon, 2 Dec 2019 21:47:10 +0800 Subject: [PATCH] Allow users to more easily select MemoryStore. (#1311) --- src/neo/NeoSystem.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/neo/NeoSystem.cs b/src/neo/NeoSystem.cs index 047ee71604..c5e0d0d8e5 100644 --- a/src/neo/NeoSystem.cs +++ b/src/neo/NeoSystem.cs @@ -33,7 +33,9 @@ public class NeoSystem : IDisposable public NeoSystem(string storageEngine = null) { Plugin.LoadPlugins(this); - this.store = storageEngine is null ? new MemoryStore() : Plugin.Storages[storageEngine].GetStore(); + this.store = string.IsNullOrEmpty(storageEngine) || storageEngine == nameof(MemoryStore) + ? new MemoryStore() + : Plugin.Storages[storageEngine].GetStore(); this.Blockchain = ActorSystem.ActorOf(Ledger.Blockchain.Props(this, store)); this.LocalNode = ActorSystem.ActorOf(Network.P2P.LocalNode.Props(this)); this.TaskManager = ActorSystem.ActorOf(Network.P2P.TaskManager.Props(this));