X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Fchain%2Fchannelmonitor.rs;h=7e721f6307160b8a9d7db20d552932b0789e6875;hb=78c3080537a0ed54bc3b105790b046f938379a2f;hp=9c6030c4131baca56d530efd7537184a6cc24545;hpb=e4cc7db63e7ed17c9e48318ecb21f09aea43401a;p=rust-lightning diff --git a/lightning/src/chain/channelmonitor.rs b/lightning/src/chain/channelmonitor.rs index 9c6030c4..7e721f63 100644 --- a/lightning/src/chain/channelmonitor.rs +++ b/lightning/src/chain/channelmonitor.rs @@ -166,11 +166,11 @@ pub struct HTLCUpdate { pub(crate) payment_hash: PaymentHash, pub(crate) payment_preimage: Option, pub(crate) source: HTLCSource, - pub(crate) onchain_value_satoshis: Option, + pub(crate) htlc_value_satoshis: Option, } impl_writeable_tlv_based!(HTLCUpdate, { (0, payment_hash, required), - (1, onchain_value_satoshis, option), + (1, htlc_value_satoshis, option), (2, source, required), (4, payment_preimage, option), }); @@ -357,7 +357,7 @@ enum OnchainEvent { HTLCUpdate { source: HTLCSource, payment_hash: PaymentHash, - onchain_value_satoshis: Option, + htlc_value_satoshis: Option, /// None in the second case, above, ie when there is no relevant output in the commitment /// transaction which appeared on chain. commitment_tx_output_idx: Option, @@ -423,7 +423,7 @@ impl MaybeReadable for OnchainEventEntry { impl_writeable_tlv_based_enum_upgradable!(OnchainEvent, (0, HTLCUpdate) => { (0, source, required), - (1, onchain_value_satoshis, option), + (1, htlc_value_satoshis, option), (2, payment_hash, required), (3, commitment_tx_output_idx, option), }, @@ -1689,7 +1689,7 @@ macro_rules! fail_unbroadcast_htlcs { event: OnchainEvent::HTLCUpdate { source: (**source).clone(), payment_hash: htlc.payment_hash.clone(), - onchain_value_satoshis: Some(htlc.amount_msat / 1000), + htlc_value_satoshis: Some(htlc.amount_msat / 1000), commitment_tx_output_idx: None, }, }; @@ -2523,7 +2523,7 @@ impl ChannelMonitorImpl { // Produce actionable events from on-chain events having reached their threshold. for entry in onchain_events_reaching_threshold_conf.drain(..) { match entry.event { - OnchainEvent::HTLCUpdate { ref source, payment_hash, onchain_value_satoshis, commitment_tx_output_idx } => { + OnchainEvent::HTLCUpdate { ref source, payment_hash, htlc_value_satoshis, commitment_tx_output_idx } => { // Check for duplicate HTLC resolutions. #[cfg(debug_assertions)] { @@ -2545,7 +2545,7 @@ impl ChannelMonitorImpl { payment_hash, payment_preimage: None, source: source.clone(), - onchain_value_satoshis, + htlc_value_satoshis, })); if let Some(idx) = commitment_tx_output_idx { self.htlcs_resolved_on_chain.push(IrrevocablyResolvedHTLC { commitment_tx_output_idx: idx, payment_preimage: None }); @@ -2887,7 +2887,7 @@ impl ChannelMonitorImpl { source, payment_preimage: Some(payment_preimage), payment_hash, - onchain_value_satoshis: Some(amount_msat / 1000), + htlc_value_satoshis: Some(amount_msat / 1000), })); } } else if offered_preimage_claim { @@ -2908,7 +2908,7 @@ impl ChannelMonitorImpl { source, payment_preimage: Some(payment_preimage), payment_hash, - onchain_value_satoshis: Some(amount_msat / 1000), + htlc_value_satoshis: Some(amount_msat / 1000), })); } } else { @@ -2926,7 +2926,7 @@ impl ChannelMonitorImpl { height, event: OnchainEvent::HTLCUpdate { source, payment_hash, - onchain_value_satoshis: Some(amount_msat / 1000), + htlc_value_satoshis: Some(amount_msat / 1000), commitment_tx_output_idx: Some(input.previous_output.vout), }, };