From: Valentine Wallace Date: Fri, 4 Nov 2022 16:42:48 +0000 (-0400) Subject: Track incoming amount in PendingHTLCInfo X-Git-Tag: v0.0.113~50^2~1 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=203394ff94fb3fe406f075e7c5509e1eb38cc655;p=rust-lightning Track incoming amount in PendingHTLCInfo Used in upcoming commit(s) when we generate the PaymentIntercepted event for intercepted payments. Co-authored-by: John Cantrell Co-authored-by: Valentine Wallace --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index 9e087785b..c28ca5cf3 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -113,6 +113,7 @@ pub(super) struct PendingHTLCInfo { pub(super) incoming_shared_secret: [u8; 32], payment_hash: PaymentHash, pub(super) amt_to_forward: u64, + pub(super) amt_incoming: Option, // Added in 0.0.113 pub(super) outgoing_cltv_value: u32, } @@ -2196,6 +2197,7 @@ impl ChannelManager ChannelManager ChannelManager { macro_rules! failure_handler { @@ -3262,7 +3265,7 @@ impl ChannelManager { log_trace!(self.logger, "Adding HTLC from short id {} with payment_hash {} to channel with short id {} after delay", prev_short_channel_id, log_bytes!(payment_hash.0), short_chan_id); @@ -6470,7 +6473,8 @@ impl_writeable_tlv_based!(PendingHTLCInfo, { (2, incoming_shared_secret, required), (4, payment_hash, required), (6, amt_to_forward, required), - (8, outgoing_cltv_value, required) + (8, outgoing_cltv_value, required), + (9, amt_incoming, option), });