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

fix liquid pending timestamp #613

Merged
merged 2 commits into from
Dec 17, 2024
Merged

fix liquid pending timestamp #613

merged 2 commits into from
Dec 17, 2024

Conversation

roeierez
Copy link
Member

@roeierez roeierez commented Dec 16, 2024

Before this PR pending liquid transactions that were synced were shown at the bottom of the list payments.
This is because their timestamp was null as there was no swap and the transactions was in the mempool.
Now it fallbacks to the current timestamp for pending transaction.

fixed #611

@@ -268,7 +268,7 @@ impl Persister {
ptx.tx_id NOT IN (SELECT refund_tx_id FROM chain_swaps WHERE refund_tx_id NOT NULL)
AND {}
ORDER BY -- Order by swap creation time or tx timestamp (in case of direct tx)
COALESCE(rs.created_at, ss.created_at, cs.created_at, ptx.timestamp) DESC
COALESCE(rs.created_at, ss.created_at, cs.created_at, ptx.timestamp, strftime('%s', 'now')) DESC
Copy link
Collaborator

@dangeross dangeross Dec 16, 2024

Choose a reason for hiding this comment

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

Would it make sense to store the "seen" time (current time) in the db in this case if there is no tx timestamp? Otherwise won't these payments bubble up the payment list

edit: maybe it isn't a bad thing as the eventual tx timestamp will be later anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense but I will need to make sure we don't override the timestamp as we are doing "insert or replace" for tx_data.
I will take a look.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@roeierez roeierez requested a review from dangeross December 16, 2024 21:38
@roeierez roeierez merged commit 7c410d4 into rt-sync Dec 17, 2024
9 checks passed
@roeierez roeierez changed the title fix liquid panding timestamp fix liquid pending timestamp Dec 17, 2024
hydra-yse pushed a commit that referenced this pull request Dec 24, 2024
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.

3 participants