Function FlashAPI.proposeUpdate

Proposes updating the channel by resolving all pending HTLCs with the secrets the counter-party offers.

abstract Result!(agora.flash.Types.PublicNonce) proposeUpdate (
  PublicKey sender_pk,
  PublicKey recv_pk,
  geod24.bitblob.BitBlob!(64L) chan_id,
  uint seq_id,
  geod24.bitblob.BitBlob!(64L)[] secrets,
  geod24.bitblob.BitBlob!(64L)[] rev_htlcs,
  PublicNonce peer_nonce,
  Height height
) @safe;

When there is a payment route from A => B => C using proposePayment(), there will also be an update route from C => B => A using proposeUpdate() in order to settle HTLCs.

Note that this API is fee-less. There is no associated fee involved as there are no payments being routed through this call, only the HTLCs are consolidated into their respective outputs.

Parameters

NameDescription
sender_pk the sender public key as managed by the counter-party. (note: will be used for signature authentication later)
recv_pk the receiving public key. If the receiving flash node does not manage this key it will return an error.
chan_id an existing channel ID
seq_id the new sequence ID
secrets the secrets the proposer wishes to disclose
rev_htlcs the htlcs the proposer wishes to drop
peer_nonce the nonce the calling peer will use
height the block height of the calling node. This is needed in order to properly resolve any pending HTLCs in the channel. For example, timed-out HTLCs should be replaced with a payout back to the funder. If the called node's local block height does not match the provided block height, an error will be returned.

Returns

the nonce the receiving node will use, or an error code if the secrets are unrecognized