diff --git a/src/Neo.CLI/CLI/MainService.Network.cs b/src/Neo.CLI/CLI/MainService.Network.cs index 38d6fd1d28..c579b8323e 100644 --- a/src/Neo.CLI/CLI/MainService.Network.cs +++ b/src/Neo.CLI/CLI/MainService.Network.cs @@ -117,7 +117,7 @@ private void OnBroadcastInvCommand(InventoryType type, UInt256[] payload) [ConsoleCommand("broadcast transaction", Category = "Network Commands")] private void OnBroadcastTransactionCommand(UInt256 hash) { - if (NeoSystem.MemPool.TryGetValue(hash, out Transaction tx)) + if (NeoSystem.MemPool.TryGetValue(hash, out var tx)) OnBroadcastCommand(MessageCommand.Transaction, tx); } diff --git a/src/Neo.CLI/CLI/MainService.Wallet.cs b/src/Neo.CLI/CLI/MainService.Wallet.cs index db33e89564..f1390612bc 100644 --- a/src/Neo.CLI/CLI/MainService.Wallet.cs +++ b/src/Neo.CLI/CLI/MainService.Wallet.cs @@ -618,7 +618,7 @@ private void OnCancelCommand(UInt256 txid, UInt160? sender = null, UInt160[]? si return; } - if (NeoSystem.MemPool.TryGetValue(txid, out Transaction conflictTx)) + if (NeoSystem.MemPool.TryGetValue(txid, out var conflictTx)) { tx.NetworkFee = Math.Max(tx.NetworkFee, conflictTx.NetworkFee) + 1; } diff --git a/src/Neo/Ledger/MemoryPool.cs b/src/Neo/Ledger/MemoryPool.cs index ff9c6b1069..8f9437641b 100644 --- a/src/Neo/Ledger/MemoryPool.cs +++ b/src/Neo/Ledger/MemoryPool.cs @@ -159,7 +159,7 @@ public bool ContainsKey(UInt256 hash) /// The hash of the to get. /// When this method returns, contains the associated with the specified hash, if the hash is found; otherwise, . /// if the contains a with the specified hash; otherwise, . - public bool TryGetValue(UInt256 hash, [MaybeNullWhen(false)] out Transaction? tx) + public bool TryGetValue(UInt256 hash, [NotNullWhen(true)] out Transaction? tx) { _txRwLock.EnterReadLock(); try