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

null checks for #3364 and fix some bugs #1

Closed
wants to merge 1 commit into from

Conversation

shargon
Copy link

@shargon shargon commented Jun 28, 2024

@Jim8y I removed the new warnings created by neo-project#3364 , but I found a bug, sortedPool in line 407 can be null because line 259

@@ -291,7 +291,10 @@ internal bool CanTransactionFitInPool(Transaction tx)
{
if (Count < Capacity) return true;

return GetLowestFeeTransaction(out _, out _).CompareTo(tx) <= 0;
var item = GetLowestFeeTransaction(out _, out _);
if (item == null) return false;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can fail if it's null

@@ -400,7 +403,8 @@ private List<Transaction> RemoveOverCapacity()
List<Transaction> removedTransactions = new();
do
{
PoolItem minItem = GetLowestFeeTransaction(out var unsortedPool, out var sortedPool);
var minItem = GetLowestFeeTransaction(out var unsortedPool, out var sortedPool);
if (minItem == null || sortedPool == null) break;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can fail if it's null, because lime 259 and 262

@shargon shargon changed the title null checks for #3334 null checks for #3334 and fix some bugs Jun 28, 2024
@shargon shargon changed the title null checks for #3334 and fix some bugs null checks for #3364 and fix some bugs Jun 28, 2024
@Jim8y
Copy link
Owner

Jim8y commented Jun 28, 2024

this should be your pr on master, please do it on master directly

@Jim8y Jim8y changed the base branch from fix-2862 to master June 28, 2024 16:20
@Jim8y Jim8y changed the base branch from master to fix-2862 June 28, 2024 16:20
@shargon shargon closed this Jun 28, 2024
@shargon shargon deleted the 2862-remove-null branch June 28, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants