ilp-protocol-stream
ilp-protocol-stream copied to clipboard
fix: start with the amount used to calculate the exchange rate
Use the packet amount from the best exchange rate calculation so instead of using the max which we know will bounce due to a T04 we use what we know can make it through.
Current logic: 1, 1000, 1000000, 1000000000, 10000000000000 -> Sent 0, 2, F08, F08, F08 <- max amount 100,000
100,000 -> Sent T04 <-
66,000 -> Sent Success <-
Start sending using: 100,000. New logic will use the 66,000 so we don't immediately trigger a T04.
Could you add a test that exercises the case described in the PR description?