Skip to content

Fix total_payment_confirmed #153

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

qlpqlp
Copy link
Contributor

@qlpqlp qlpqlp commented Jun 17, 2025

I detected on the Dogecoin hackathon website wen checking invoices that the total_payment_confirmed were not being added and so my background confirmations failled to check after the latest update

This changes verifies and adds the total_payment_confirmed correctly

I detected on the Dogecoin hackathon website wen checking invoices that the total_payment_confirmed  were not being added and so my background confirmations failled to check after the latest update

This changes verifies and adds the total_payment_confirmed correctly
@qlpqlp qlpqlp requested a review from raffecat June 17, 2025 22:05
@qlpqlp qlpqlp self-assigned this Jun 17, 2025
@qlpqlp qlpqlp added the bug Something isn't working label Jun 17, 2025
@@ -134,19 +133,18 @@ func (i *Invoice) ToPublic() PublicInvoice {
Estimate: 0, // XXX meant to estimate time until confirmation
}

if i.LastIncomingAmount.IsPositive() {
if i.LastPaidAmount.IsPositive() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not convinced this is right. The reason is: LastPaidAmount is only confirmed amounts after 6 blocks, but PartDetected is meant to be an early notification that some payment is incoming, so it uses IncomingAmount the unconfirmed balance after 1 block.

pub.PartDetected = true
}

if i.LastIncomingAmount.GreaterThanOrEqual(i.Total) {
if i.LastPaidAmount.GreaterThanOrEqual(i.Total) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The same situation. TotalDetected is notice that the whole payment is incoming, but not confirmed yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

strange, because even if enough blocks, in my case 1 block is set, it dosent add to the database that was full paid :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants