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

gui: add listcoins filters #967

Merged
merged 14 commits into from
Apr 19, 2024

Conversation

jp1ac4
Copy link
Collaborator

@jp1ac4 jp1ac4 commented Feb 9, 2024

This is to resolve #677.

As well as adding the filters to the daemon interface, I've applied filters in separate commits to different sections of the GUI.

This PR builds on changes from #958 and #965. The latter is required when filtering for pending transactions so that a coin whose spending txid changes (e.g. due to RBF) remains as spending.

@edouardparis
Copy link
Member

Beware that the application use the Coins message passing by to update its cache:
https://github.com/wizardsardine/liana/blob/master/gui/src/app/mod.rs#L155
If the coins message is filtered then the cache is wrong, so maybe before doing this kind of change, we should first merge an equivalent of #959 where every panel state is kept with its own coins list for example and the cache becomes unnecessary.

One of the main advantages of the new list_coins filter is the outpoints filter, we should use it in the daemon methods that retrieve the coins which outpoints are corresponding to the inputs and the outputs of the resulting HistoryTransaction, Psbt etc

@jp1ac4 jp1ac4 force-pushed the gui-add-listcoins-filters branch from 0391903 to 3419df1 Compare March 27, 2024 14:00
@jp1ac4 jp1ac4 marked this pull request as ready for review March 27, 2024 17:15
// TODO: filter for the outpoints in `tx.coins` when this is possible:
// https://github.com/wizardsardine/liana/issues/677
.list_coins()
.list_coins(&[CoinStatus::Spending], &outpoints)
Copy link
Member

@edouardparis edouardparis Apr 18, 2024

Choose a reason for hiding this comment

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

we use the outpoint, it is enough, you can remove the status filter. My fear is that the coin exists, just is not yet marked as spending

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's OK to keep the status filter here as the previous filter_map was already filtering for coins with a non-null spend txid.

Copy link
Member

Choose a reason for hiding this comment

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

Ah you may right, I think we are good then.

// TODO: filter for spending coins when this is possible:
// https://github.com/wizardsardine/liana/issues/677
.list_coins()
.list_coins(&[CoinStatus::Spending], &outpoints)
Copy link
Member

Choose a reason for hiding this comment

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

we use the outpoint, it is enough, you can remove the status filter. My fear is that the coin exists, just is not yet marked as spending

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As with the other comment, I've kept the status filter.

@jp1ac4 jp1ac4 force-pushed the gui-add-listcoins-filters branch from 3419df1 to 1c99376 Compare April 18, 2024 19:19
Copy link
Member

@edouardparis edouardparis left a comment

Choose a reason for hiding this comment

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

ACK 1c99376

@edouardparis edouardparis merged commit f9ea8ec into wizardsardine:master Apr 19, 2024
21 checks passed
@nondiremanuel nondiremanuel added this to the Liana v6 milestone Jun 25, 2024
@jp1ac4 jp1ac4 deleted the gui-add-listcoins-filters branch November 6, 2024 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Status: Done
Development

Successfully merging this pull request may close these issues.

Use listcoins filters in the GUI
3 participants