Commitments
data class Commitments(channelConfig: ChannelConfig, channelFeatures: ChannelFeatures, localParams: LocalParams, remoteParams: RemoteParams, channelFlags: Byte, localCommit: LocalCommit, remoteCommit: RemoteCommit, localChanges: LocalChanges, remoteChanges: RemoteChanges, localNextHtlcId: Long, remoteNextHtlcId: Long, payments: Map<Long, UUID>, remoteNextCommitInfo: Either<WaitingForRevocation, PublicKey>, commitInput: Transactions.InputInfo, remotePerCommitmentSecrets: ShaChain, channelId: ByteVector32, remoteChannelData: EncryptedChannelData)
Content copied to clipboard
about remoteNextCommitInfo: we either:
have built and signed their next commit tx with their next revocation hash which can now be discarded
have their next per-commitment point So, when we've signed and sent a commit message and are waiting for their revocation message, theirNextCommitInfo is their next commit tx. The rest of the time, it is their next per-commitment point
Constructors
Commitments
Link copied to clipboard
fun Commitments(channelConfig: ChannelConfig, channelFeatures: ChannelFeatures, localParams: LocalParams, remoteParams: RemoteParams, channelFlags: Byte, localCommit: LocalCommit, remoteCommit: RemoteCommit, localChanges: LocalChanges, remoteChanges: RemoteChanges, localNextHtlcId: Long, remoteNextHtlcId: Long, payments: Map<Long, UUID>, remoteNextCommitInfo: Either<WaitingForRevocation, PublicKey>, commitInput: Transactions.InputInfo, remotePerCommitmentSecrets: ShaChain, channelId: ByteVector32, remoteChannelData: EncryptedChannelData = EncryptedChannelData.empty)
Content copied to clipboard
Types
Functions
almost Timed Out Incoming Htlcs
Link copied to clipboard
fun almostTimedOutIncomingHtlcs(blockHeight: Long, fulfillSafety: CltvExpiryDelta): Set<UpdateAddHtlc>
Content copied to clipboard
Incoming HTLCs that are close to timing out are potentially dangerous. If we released the pre-image for those HTLCs, we need to get a remote signed updated commitment that removes this HTLC. Otherwise when we get close to the timeout, we risk an on-chain race condition between their HTLC timeout and our HTLC success in case of a force-close.
available Balance For Receive
Link copied to clipboard
available Balance For Send
Link copied to clipboard
has No Pending Htlcs
Link copied to clipboard
has No Pending Htlcs Or Fee Update
Link copied to clipboard
is More Recent
Link copied to clipboard
local Has Changes
Link copied to clipboard
local Has Unsigned Outgoing Htlcs
Link copied to clipboard
local Has Unsigned Outgoing Update Fee
Link copied to clipboard
nothing At Stake
Link copied to clipboard
receive Add
Link copied to clipboard
fun receiveAdd(add: UpdateAddHtlc): Either<ChannelException, Commitments>
Content copied to clipboard
receive Commit
Link copied to clipboard
fun receiveCommit(commit: CommitSig, keyManager: KeyManager, log: Logger): Either<ChannelException, Pair<Commitments, RevokeAndAck>>
Content copied to clipboard
receive Fail
Link copied to clipboard
fun receiveFail(fail: UpdateFailHtlc): Either<ChannelException, Triple<Commitments, UUID, UpdateAddHtlc>>
Content copied to clipboard
receive Fail Malformed
Link copied to clipboard
fun receiveFailMalformed(fail: UpdateFailMalformedHtlc): Either<ChannelException, Triple<Commitments, UUID, UpdateAddHtlc>>
Content copied to clipboard
receive Fee
Link copied to clipboard
fun receiveFee(fee: UpdateFee, feerateTolerance: FeerateTolerance): Either<ChannelException, Commitments>
Content copied to clipboard
receive Fulfill
Link copied to clipboard
fun receiveFulfill(fulfill: UpdateFulfillHtlc): Either<ChannelException, Triple<Commitments, UUID, UpdateAddHtlc>>
Content copied to clipboard
receive Revocation
Link copied to clipboard
fun receiveRevocation(revocation: RevokeAndAck): Either<ChannelException, Pair<Commitments, List<ChannelAction>>>
Content copied to clipboard
remote Has Changes
Link copied to clipboard
remote Has Unsigned Outgoing Htlcs
Link copied to clipboard
remote Has Unsigned Outgoing Update Fee
Link copied to clipboard
send Add
Link copied to clipboard
fun sendAdd(cmd: CMD_ADD_HTLC, paymentId: UUID, blockHeight: Long): Either<ChannelException, Pair<Commitments, UpdateAddHtlc>>
Content copied to clipboard
send Commit
Link copied to clipboard
fun sendCommit(keyManager: KeyManager, log: Logger): Either<ChannelException, Pair<Commitments, CommitSig>>
Content copied to clipboard
send Fail
Link copied to clipboard
fun sendFail(cmd: CMD_FAIL_HTLC, nodeSecret: PrivateKey): Either<ChannelException, Pair<Commitments, UpdateFailHtlc>>
Content copied to clipboard
send Fail Malformed
Link copied to clipboard
fun sendFailMalformed(cmd: CMD_FAIL_MALFORMED_HTLC): Either<ChannelException, Pair<Commitments, UpdateFailMalformedHtlc>>
Content copied to clipboard
send Fee
Link copied to clipboard
fun sendFee(cmd: CMD_UPDATE_FEE): Either<ChannelException, Pair<Commitments, UpdateFee>>
Content copied to clipboard
send Fulfill
Link copied to clipboard
fun sendFulfill(cmd: CMD_FULFILL_HTLC): Either<ChannelException, Pair<Commitments, UpdateFulfillHtlc>>
Content copied to clipboard
timed Out Outgoing Htlcs
Link copied to clipboard
update Features
Link copied to clipboard
Properties
channelConfig
Link copied to clipboard
channelFeatures
Link copied to clipboard
channelFlags
Link copied to clipboard
commitInput
Link copied to clipboard
localChanges
Link copied to clipboard
localCommit
Link copied to clipboard
localNextHtlcId
Link copied to clipboard
localParams
Link copied to clipboard
remoteChanges
Link copied to clipboard
remoteChannelData
Link copied to clipboard
remoteCommit
Link copied to clipboard
remoteNextCommitInfo
Link copied to clipboard
remoteNextHtlcId
Link copied to clipboard
remoteParams
Link copied to clipboard
remotePerCommitmentSecrets
Link copied to clipboard