pub(crate) payment_hash: PaymentHash,
pub(crate) payment_preimage: Option<PaymentPreimage>,
pub(crate) source: HTLCSource,
- pub(crate) onchain_value_satoshis: Option<u64>,
+ pub(crate) htlc_value_satoshis: Option<u64>,
}
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),
});
HTLCUpdate {
source: HTLCSource,
payment_hash: PaymentHash,
- onchain_value_satoshis: Option<u64>,
+ htlc_value_satoshis: Option<u64>,
/// 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<u32>,
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),
},
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,
},
};
// 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)]
{
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 });
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 {
source,
payment_preimage: Some(payment_preimage),
payment_hash,
- onchain_value_satoshis: Some(amount_msat / 1000),
+ htlc_value_satoshis: Some(amount_msat / 1000),
}));
}
} else {
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),
},
};
MonitorEvent::HTLCEvent(htlc_update) => {
if let Some(preimage) = htlc_update.payment_preimage {
log_trace!(self.logger, "Claiming HTLC with preimage {} from our monitor", log_bytes!(preimage.0));
- self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage, htlc_update.onchain_value_satoshis.map(|v| v * 1000), true, funding_outpoint.to_channel_id());
+ self.claim_funds_internal(self.channel_state.lock().unwrap(), htlc_update.source, preimage, htlc_update.htlc_value_satoshis.map(|v| v * 1000), true, funding_outpoint.to_channel_id());
} else {
log_trace!(self.logger, "Failing HTLC with hash {} from our monitor", log_bytes!(htlc_update.payment_hash.0));
self.fail_htlc_backwards_internal(self.channel_state.lock().unwrap(), htlc_update.source, &htlc_update.payment_hash, HTLCFailReason::Reason { failure_code: 0x4000 | 8, data: Vec::new() });