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

Simplified get_transfers and fixed sort segfault #890

Merged
merged 1 commit into from
Oct 10, 2019

Conversation

jagerman
Copy link
Member

@jagerman jagerman commented Oct 10, 2019

Most of this is simplification while I stepped through the function:

  • use a for (x : list) loop instead of manual iterator handling
  • don't bother double-checking args.in etc.: if they aren't specified the associated container will be empty anyway.
  • replace (!((args.failed && is_failed) || (!is_failed && args.pending))) with logically equivalent !(is_failed ? args.failed : args.pending) (and then removed the negation, too).

The segfault is fixed by the change inside the sort: because only the case a.confirmed && !b.confirmed was handled but not the complement !a.confirmed && b.confirmed you could get a case where two transfer_views both compare earlier than each other.

@Doy-lee Doy-lee merged commit 6716f7f into oxen-io:dev Oct 10, 2019
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.

None yet

2 participants