diff --git a/src/Neo/Wallets/NEP6/NEP6Wallet.cs b/src/Neo/Wallets/NEP6/NEP6Wallet.cs index 9cbcb9a7e3..71a5c73a33 100644 --- a/src/Neo/Wallets/NEP6/NEP6Wallet.cs +++ b/src/Neo/Wallets/NEP6/NEP6Wallet.cs @@ -72,6 +72,7 @@ public NEP6Wallet(string path, string password, ProtocolSettings settings, strin accounts = new Dictionary(); extra = JToken.Null; } + Thread.MemoryBarrier(); } /// @@ -85,6 +86,7 @@ public NEP6Wallet(string path, string password, ProtocolSettings settings, JObje { this.password = password.ToSecureString(); LoadFromJson(json, out Scrypt, out accounts, out extra); + Thread.MemoryBarrier(); } private void LoadFromJson(JObject wallet, out ScryptParameters scrypt, out Dictionary accounts, out JToken extra) @@ -94,7 +96,6 @@ private void LoadFromJson(JObject wallet, out ScryptParameters scrypt, out Dicti scrypt = ScryptParameters.FromJson((JObject)wallet["scrypt"]); accounts = ((JArray)wallet["accounts"]).Select(p => NEP6Account.FromJson((JObject)p, this)).ToDictionary(p => p.ScriptHash); extra = wallet["extra"]; - Thread.MemoryBarrier(); if (!VerifyPasswordInternal(password.GetClearText())) throw new InvalidOperationException("Wrong password."); }