Skip to content

Commit

Permalink
Allow users to more easily select MemoryStore. (neo-project#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang authored and Luchuan committed Jan 10, 2020
1 parent 3793106 commit bc0f9b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/neo/NeoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit bc0f9b0

Please sign in to comment.