Going back up the thread, what if we just track a single net balance number and, for nodes that accept pre-payment, have a separate number to track prepaid funds?
All ILP packets would affect the normal net balance position, and outgoing settlements would be based on this position.
When you get an incoming settlement, you would clear out as much of the peer’s debt as the settlement covers and any extra would be put into the prepaid funds account.
To be on the conservative side, if you’re pre-paying, you may want to have an explicit check to make sure you avoid the settling back and forth forever issue (there may be a better check but if you’re sending and receiving settlements with the same peer without having sent ILP packets, you may want to stop).
This still begs the question of what a positive vs negative balance represents
Update: I agree with @sappenin’s original comment that a positive balance should represent a liability. That way, both the balance and the prepaid amount are tracked in the same way.