Package org.ldk.structs
Class CommitmentTransaction
- java.lang.Object
-
- org.ldk.structs.CommitmentTransaction
-
public class CommitmentTransaction extends Object
This class tracks the per-transaction information needed to build a commitment transaction and will actually build it and sign. It is used for holder transactions that we sign only when needed and for transactions we sign for the counterparty. This class can be used inside a signer implementation to generate a signature given the relevant secret key.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CommitmentTransaction
clone()
Creates a copy of the CommitmentTransactionlong
commitment_number()
The backwards-counting commitment numberint
feerate_per_kw()
The feerate paid per 1000-weight-unit in this commitment transaction.protected void
finalize()
static Result_CommitmentTransactionDecodeErrorZ
read(byte[] ser)
Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_writelong
to_broadcaster_value_sat()
The value to be sent to the broadcasterlong
to_countersignatory_value_sat()
The value to be sent to the counterpartyTrustedCommitmentTransaction
trust()
Trust our pre-built transaction and derived transaction creation public keys.Result_TrustedCommitmentTransactionNoneZ
verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys)
Verify our pre-built transaction and derived transaction creation public keys.byte[]
write()
Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
clone
public CommitmentTransaction clone()
Creates a copy of the CommitmentTransaction
-
write
public byte[] write()
Serialize the CommitmentTransaction object into a byte array which can be read by CommitmentTransaction_read
-
read
public static Result_CommitmentTransactionDecodeErrorZ read(byte[] ser)
Read a CommitmentTransaction from a byte array, created by CommitmentTransaction_write
-
commitment_number
public long commitment_number()
The backwards-counting commitment number
-
to_broadcaster_value_sat
public long to_broadcaster_value_sat()
The value to be sent to the broadcaster
-
to_countersignatory_value_sat
public long to_countersignatory_value_sat()
The value to be sent to the counterparty
-
feerate_per_kw
public int feerate_per_kw()
The feerate paid per 1000-weight-unit in this commitment transaction.
-
trust
public TrustedCommitmentTransaction trust()
Trust our pre-built transaction and derived transaction creation public keys. Applies a wrapper which allows access to these fields. This should only be used if you fully trust the builder of this object. It should not be used by an external signer - instead use the verify function.
-
verify
public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys)
Verify our pre-built transaction and derived transaction creation public keys. Applies a wrapper which allows access to these fields. An external validating signer must call this method before signing or using the built transaction.
-
-