machinomy / machinomy

Node.js library for micropayments in Ether and ERC20 tokens over HTTP

Home Page:http://machinomy.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Should `acceptPayment` throw an error if the payment is for less than a previous payment?

kincaidoneil opened this issue · comments

My understanding is that if the payment is otherwise valid, it persists it to the db, and only when claiming the channel, the receiver checks for the payment with the maximum value.

For our use case, we really need the ability to know what the largest payment/best claim is so we can reject payments for which the value is less than a previous payment.

Is there a way to do that using the current API? Or should acceptPayment throw an error if it's not the greatest payment?

Hi, @kincaidoneil ! Good suggestion. We plan to realize this check after we'll finish ERC20 support.

Merged. Thank you very much for contributing!