According to the glossary, the capacity does not care about locks:
A channel's capacity is the sum of the total deposits minus the sum of the total withdraws of both its participants
while the term "distributable" does:
distributable = get_balance(sender, receiver) - get_amount_locked(sender)
Since these two terms mean different things, the following code is wrong or at least highly misleading:
class ChannelStateSchema(BaseSchema):
...
@staticmethod
def get_balance(channel_state):
return channel.get_distributable(channel_state.our_state, channel_state.partner_state)
According to the glossary, the capacity does not care about locks:
while the term "distributable" does:
distributable = get_balance(sender, receiver) - get_amount_locked(sender)Since these two terms mean different things, the following code is wrong or at least highly misleading: