Helpers

object Helpers

Types

Closing
Link copied to clipboard
common
object Closing
Funding
Link copied to clipboard
common
object Funding

Functions

aboveReserve
Link copied to clipboard
common
fun aboveReserve(commitments: Commitments): Boolean

This indicates whether our side of the channel is above the reserve requested by our counterparty. In other words, this tells if we can use the channel to make a payment.

checkLocalCommit
Link copied to clipboard
common
fun checkLocalCommit(commitments: Commitments, nextRemoteRevocationNumber: Long): Boolean

Tells whether or not their expected next remote commitment number matches with our data

checkRemoteCommit
Link copied to clipboard
common
fun checkRemoteCommit(commitments: Commitments, nextLocalCommitmentNumber: Long): Boolean

Tells whether or not their expected next local commitment number matches with our data

isFeeDiffTooHigh
Link copied to clipboard
common
fun isFeeDiffTooHigh(referenceFee: FeeratePerKw, currentFee: FeeratePerKw, tolerance: FeerateTolerance): Boolean
minDepthForFunding
Link copied to clipboard
common
fun minDepthForFunding(nodeParams: NodeParams, fundingAmount: Satoshi): Int

Returns the number of confirmations needed to safely handle the funding transaction, we make sure the cumulative block reward largely exceeds the channel size.

publishIfNeeded
Link copied to clipboard
common
fun publishIfNeeded(txs: List<Transaction>, irrevocablySpent: Map<OutPoint, Transaction>, channelId: ByteVector32): List<ChannelAction.Blockchain.PublishTx>

This helper method will publish txs only if they haven't yet reached minDepth.

validateParamsFundee
Link copied to clipboard
common
fun validateParamsFundee(nodeParams: NodeParams, open: OpenChannel, localParams: LocalParams, remoteFeatures: Features): Either<ChannelException, ChannelFeatures>

Called by the fundee.

validateParamsFunder
Link copied to clipboard
common
fun validateParamsFunder(nodeParams: NodeParams, init: ChannelEvent.InitFunder, open: OpenChannel, accept: AcceptChannel): Either<ChannelException, ChannelFeatures>

Called by the funder.

watchConfirmedIfNeeded
Link copied to clipboard
common
fun watchConfirmedIfNeeded(txs: List<Transaction>, irrevocablySpent: Map<OutPoint, Transaction>, channelId: ByteVector32, minDepth: Long): List<ChannelAction.Blockchain.SendWatch>

This helper method will watch txs only if they haven't yet reached minDepth.

watchSpentIfNeeded
Link copied to clipboard
common
fun watchSpentIfNeeded(parentTx: Transaction, outputs: List<OutPoint>, irrevocablySpent: Map<OutPoint, Transaction>, channelId: ByteVector32): List<ChannelAction.Blockchain.SendWatch>

This helper method will watch txs only if the utxo they spend hasn't already been irrevocably spent.

Properties

logger
Link copied to clipboard
common
val logger: Logger