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: only log a warning if there is no preimage when settling an incoming transaction #666

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rolznz
Copy link
Contributor

@rolznz rolznz commented Sep 19, 2024

Fixes #651

Alternative fix as the cashu connector is a bit broken right now (incoming payments do not show because of a check to ensure there is a preimage set) and there is nothing in the cashu spec to reveal preimages for receiving payments.

I am not really sure this is good or not - ideally all the settled transactions in our DB have preimages.

@rolznz rolznz requested a review from bumi September 19, 2024 03:50
@bumi
Copy link
Contributor

bumi commented Sep 19, 2024

I am always a bit hesitant with such exceptions they will always haunt one the one way or the other. At least they make the code harder to understand and cause questions in the future. why would a settled payment not require a preimage. or some other calculation is done assuming that all successful payments have preimages and then will cause issues.

Maintaining multiple backends is tricky and with such exceptions even harder. Why does cashu not provide a preimage there?

@rolznz
Copy link
Contributor Author

rolznz commented Sep 19, 2024

@bumi I agree. I'd prefer this to be fixed on the Cashu side.

return nil, errors.New("no preimage in payment")
}
// incoming payments SHOULD have a preimage
// (currently cashu backend does not)
Copy link
Contributor

Choose a reason for hiding this comment

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

where does this apply? only cashu? why can transactions not have a preimage.

is cashu worth this?

Choose a reason for hiding this comment

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

I also wanted to add that not only are the transactions not showing up in history, I believe the following issue is due to the same cause (not having a preimage).

When an invoice is created, in the Hub or Go, the GUI waits for payment indefinitely.

image

@rolznz rolznz marked this pull request as draft September 19, 2024 06:41
@thebullishbitcoiner
Copy link

Not sure if I should've added this comment about the "waiting for payment" issue here.

Here it is just in case.

#666 (comment)

@rolznz
Copy link
Contributor Author

rolznz commented Sep 22, 2024

I've made an issue in the cashu nuts repository: cashubtc/nuts#168

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.

Payments to Cashu backend do not appear in transaction history
3 participants