Skip to content

Disallow invoices below allowed_underpay_amount - #96

Open
kristapsk wants to merge 1 commit into
SatSale:masterfrom
kristapsk:check-allowed_underpay_amount
Open

kristapsk wants to merge 1 commit into
SatSale:masterfrom
kristapsk:check-allowed_underpay_amount

Conversation

@kristapsk

Copy link
Copy Markdown
Member

Such invoices are otherwise autoconfirmed, without user making a payment at all. Fixes #92.

End user will have the same "Amount below dust limit" message, as I don't think they should know details about configuration. But what came into my mind - should we maybe also output this amount, which would be allowed_underpay_amount for LN, max(allowed_underpay_amount,onchain_dust_limit) for onchain?

Also, likely these log messages should not be warnings, but info, as it's user generated action, not something wrong on server side.

Such invoices are otherwise autoconfirmed, without user making a payment
at all.
@nickfarrow

nickfarrow commented Sep 13, 2022

Copy link
Copy Markdown
Member

Agree, I don't have any preference as to whether users see the value. But the value isn't exactly private since you could binary search and find it quickly. Yep that max is good if we do want to display the value.

It's a shame 1 sat does not work. I'll see if i can try fix the amounts rounding

@kristapsk

Copy link
Copy Markdown
Member Author

But the value isn't exactly private since you could binary search and find it quickly.

Don't think it even needs to be private. For example, in case of donation page, it's good for user to know minimum amount he can pay.

@kristapsk

Copy link
Copy Markdown
Member Author

I'll see if i can try fix the amounts rounding

When rounding issue is solved, allowed_underpay_amount can be changed to work for onchain payments only as with LN invoices exact amount will be always paid.

@nickfarrow nickfarrow mentioned this pull request Dec 5, 2022
@kristapsk

Copy link
Copy Markdown
Member Author

I'll see if i can try fix the amounts rounding

#164 should do it.

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.

Should not allow amounts that are not above configured allowed_underpay_amount

2 participants