emschwartz / ilp-protocol-paystream

Duplex payment streams over ILP (and PSK)
https://github.com/interledger/rfcs/issues/388
2 stars 2 forks source link

Comparison math behaves weirdly when receiving negative amounts #8

Closed sharafian closed 6 years ago

sharafian commented 6 years ago

https://github.com/emschwartz/ilp-protocol-paystream/blob/master/index.ts#L156

This line will cause problems if the minBalance starts negative; the first chunk (at which the balance is 0) causes the minBalance to become 0. This means to receive a negative amount you need to set enableRefunds to true.