diff --git a/src/neo/Wallets/Wallet.cs b/src/neo/Wallets/Wallet.cs index 1e9049b72d..75dc069768 100644 --- a/src/neo/Wallets/Wallet.cs +++ b/src/neo/Wallets/Wallet.cs @@ -371,6 +371,21 @@ public long CalculateNetworkFee(StoreView snapshot, Transaction tx) foreach (UInt160 hash in hashes) { byte[] witness_script = GetAccount(hash)?.Contract?.Script; + + if (witness_script is null && tx.Witnesses != null) + { + // Try to find the script in the witnesses + + foreach (var witness in tx.Witnesses) + { + if (witness.ScriptHash == hash) + { + witness_script = witness.VerificationScript; + break; + } + } + } + if (witness_script is null) { var contract = snapshot.Contracts.TryGet(hash);