Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixed] Warning with MemoryPool #3430

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Neo.CLI/CLI/MainService.Network.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Neo.CLI/CLI/MainService.Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Neo/Ledger/MemoryPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public bool ContainsKey(UInt256 hash)
/// <param name="hash">The hash of the <see cref="Transaction"/> to get.</param>
/// <param name="tx">When this method returns, contains the <see cref="Transaction"/> associated with the specified hash, if the hash is found; otherwise, <see langword="null"/>.</param>
/// <returns><see langword="true"/> if the <see cref="MemoryPool"/> contains a <see cref="Transaction"/> with the specified hash; otherwise, <see langword="false"/>.</returns>
public bool TryGetValue(UInt256 hash, [MaybeNullWhen(false)] out Transaction? tx)
public bool TryGetValue(UInt256 hash, [NotNullWhen(true)] out Transaction? tx)
{
_txRwLock.EnterReadLock();
try
Expand Down