Function Channel.buildUpdatedBalance

Add a new HTLC to the balance and fold any HTLCs for which the timeout has expired.

Balance buildUpdatedBalance (
  in const(agora.flash.Types.PaymentDirection) direction,
  in ref const(Balance) old_balance,
  in const(Amount) amount,
  in ref const(geod24.bitblob.BitBlob!(64L)) payment_hash,
  in const(Height) lock_height,
  in const(Height) height
);

Parameters

NameDescription
old_balance the current balance
amount the invoice amount
payment_hash the invoice payment hash
lock_height the lock height for the outgoing HTLC
height the current known block height

Returns

the new balance to use during the next signing process