pub struct TlcInfo {Show 17 fields
pub status: TlcStatus,
pub tlc_id: TLCId,
pub amount: u128,
pub payment_hash: Hash256,
pub total_amount: Option<u128>,
pub payment_secret: Option<Hash256>,
pub attempt_id: Option<u64>,
pub expiry: u64,
pub hash_algorithm: HashAlgorithm,
pub onion_packet: Option<PaymentOnionPacket>,
pub shared_secret: [u8; 32],
pub is_trampoline_hop: bool,
pub created_at: CommitmentNumbers,
pub removed_reason: Option<RemoveTlcReason>,
pub forwarding_tlc: Option<(Hash256, u64)>,
pub removed_confirmed_at: Option<u64>,
pub applied_flags: AppliedFlags,
}Fields§
§status: TlcStatus§tlc_id: TLCId§amount: u128§payment_hash: Hash256§total_amount: Option<u128>bolt04 total amount of the payment, must exist if payment secret is set
payment_secret: Option<Hash256>bolt04 payment secret, only exists for last hop in multi-path payment
attempt_id: Option<u64>The attempt id associate with the tlc, only on outbound tlc only exists for first hop in multi-path payment
expiry: u64§hash_algorithm: HashAlgorithm§onion_packet: Option<PaymentOnionPacket>Shared secret used in forwarding.
Save it to backward errors. Use all zeros when no shared secrets are available.
is_trampoline_hop: bool§created_at: CommitmentNumbers§removed_reason: Option<RemoveTlcReason>§forwarding_tlc: Option<(Hash256, u64)>Note: forwarding_tlc is used to track the tlc chain for a multi-tlc payment.
For an outbound tlc, this field records the previous (upstream) tlc, so we can walk backward when removing tlcs.
For an inbound tlc, this field records the next (downstream) tlc, so we can continue tracking the forwarding path.
Example:
Node A ———> Node B ————> Node C ————> Node D tlc_1 ———> tlc_1(in) ———> tlc_2(in) ———> tlc_3 tlc_2(out) tlc_3(out) forwarding_tlc forwarding_tlc
forwarding_tlc relations:
-
Node B:
- inbound: tlc_1.forwarding_tlc = Some((channel_BC, tlc2_id))
- outbound: tlc_2.forwarding_tlc = Some((channel_AB, tlc1_id))
-
Node C:
- inbound: tlc_2.forwarding_tlc = Some((channel_CD, tlc3_id))
- outbound: tlc_3.forwarding_tlc = Some((channel_BC, tlc2_id))
removed_confirmed_at: Option<u64>§applied_flags: AppliedFlagsImplementations§
Source§impl TlcInfo
impl TlcInfo
pub fn log(&self) -> String
pub fn id(&self) -> u64
pub fn is_offered(&self) -> bool
pub fn is_received(&self) -> bool
pub fn get_commitment_numbers(&self) -> CommitmentNumbers
pub fn flip_mut(&mut self)
pub fn outbound_status(&self) -> OutboundTlcStatus
pub fn inbound_status(&self) -> InboundTlcStatus
pub fn is_fail_remove_confirmed(&self) -> bool
Sourcepub fn get_htlc_type(&self) -> u8
pub fn get_htlc_type(&self) -> u8
Get the value for the field htlc_type in commitment lock witness.
- Lowest 1 bit: 0 if the tlc is offered by the remote party, 1 otherwise.
- High 7 bits:
- 0: ckb hash
- 1: sha256