From 51ea5a2692cba8c56b935959c65d4d3a5a4f059a Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 11 May 2024 12:27:41 +0800 Subject: [PATCH] fix CalculateNetworkFee --- src/RpcServer/RpcServer.Wallet.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/RpcServer/RpcServer.Wallet.cs b/src/RpcServer/RpcServer.Wallet.cs index cc552a58a..c3e392727 100644 --- a/src/RpcServer/RpcServer.Wallet.cs +++ b/src/RpcServer/RpcServer.Wallet.cs @@ -128,9 +128,11 @@ protected virtual JToken CalculateNetworkFee(JArray _params) var tx = Convert.FromBase64String(_params[0].AsString()); JObject account = new(); - var networkfee = Wallets.Helper.CalculateNetworkFee( + wallet ??= new DummyWallet(system.Settings); + var networkfee = + Wallets.Helper.CalculateNetworkFee( tx.AsSerializable(), system.StoreView, system.Settings, - wallet is not null ? a => wallet.GetAccount(a).Contract.Script : null); + a => wallet.GetAccount(a).Contract.Script); account["networkfee"] = networkfee.ToString(); return account; }