projects
/
rust-lightning
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Note when we're allowed to unwrap channel parameters in docs
[rust-lightning]
/
lightning
/
src
/
events
/
mod.rs
diff --git
a/lightning/src/events/mod.rs
b/lightning/src/events/mod.rs
index 95f2eb357dcd57a395227b828704ad9587c7dac5..c8c736c1f713db79a72336fbb44b2ba0ae76abea 100644
(file)
--- a/
lightning/src/events/mod.rs
+++ b/
lightning/src/events/mod.rs
@@
-199,6
+199,9
@@
pub enum ClosureReason {
/// The counterparty requested a cooperative close of a channel that had not been funded yet.
/// The channel has been immediately closed.
CounterpartyCoopClosedUnfundedChannel,
/// The counterparty requested a cooperative close of a channel that had not been funded yet.
/// The channel has been immediately closed.
CounterpartyCoopClosedUnfundedChannel,
+ /// Another channel in the same funding batch closed before the funding transaction
+ /// was ready to be broadcast.
+ FundingBatchClosure,
}
impl core::fmt::Display for ClosureReason {
}
impl core::fmt::Display for ClosureReason {
@@
-219,6
+222,7
@@
impl core::fmt::Display for ClosureReason {
ClosureReason::DisconnectedPeer => f.write_str("the peer disconnected prior to the channel being funded"),
ClosureReason::OutdatedChannelManager => f.write_str("the ChannelManager read from disk was stale compared to ChannelMonitor(s)"),
ClosureReason::CounterpartyCoopClosedUnfundedChannel => f.write_str("the peer requested the unfunded channel be closed"),
ClosureReason::DisconnectedPeer => f.write_str("the peer disconnected prior to the channel being funded"),
ClosureReason::OutdatedChannelManager => f.write_str("the ChannelManager read from disk was stale compared to ChannelMonitor(s)"),
ClosureReason::CounterpartyCoopClosedUnfundedChannel => f.write_str("the peer requested the unfunded channel be closed"),
+ ClosureReason::FundingBatchClosure => f.write_str("another channel in the same funding batch closed"),
}
}
}
}
}
}
@@
-233,6
+237,7
@@
impl_writeable_tlv_based_enum_upgradable!(ClosureReason,
(10, DisconnectedPeer) => {},
(12, OutdatedChannelManager) => {},
(13, CounterpartyCoopClosedUnfundedChannel) => {},
(10, DisconnectedPeer) => {},
(12, OutdatedChannelManager) => {},
(13, CounterpartyCoopClosedUnfundedChannel) => {},
+ (15, FundingBatchClosure) => {}
);
/// Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
);
/// Intended destination of a failed HTLC as indicated in [`Event::HTLCHandlingFailed`].
@@
-508,6
+513,15
@@
pub enum Event {
/// serialized prior to LDK version 0.0.117.
sender_intended_total_msat: Option<u64>,
},
/// serialized prior to LDK version 0.0.117.
sender_intended_total_msat: Option<u64>,
},
+ /// Indicates a request for an invoice failed to yield a response in a reasonable amount of time
+ /// or was explicitly abandoned by [`ChannelManager::abandon_payment`].
+ ///
+ /// [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment
+ #[cfg(invreqfailed)]
+ InvoiceRequestFailed {
+ /// The `payment_id` to have been associated with payment for the requested invoice.
+ payment_id: PaymentId,
+ },
/// Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
/// and we got back the payment preimage for it).
///
/// Indicates an outbound payment we made succeeded (i.e. it made it all the way to its target
/// and we got back the payment preimage for it).
///
@@
-836,6
+850,8
@@
pub enum Event {
},
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
/// inputs for another purpose.
},
/// Used to indicate to the user that they can abandon the funding transaction and recycle the
/// inputs for another purpose.
+ ///
+ /// This event is not guaranteed to be generated for channels that are closed due to a restart.
DiscardFunding {
/// The channel_id of the channel which has been closed.
channel_id: ChannelId,
DiscardFunding {
/// The channel_id of the channel which has been closed.
channel_id: ChannelId,
@@
-1148,6
+1164,13
@@
impl Writeable for Event {
(8, funding_txo, required),
});
},
(8, funding_txo, required),
});
},
+ #[cfg(invreqfailed)]
+ &Event::InvoiceRequestFailed { ref payment_id } => {
+ 33u8.write(writer)?;
+ write_tlv_fields!(writer, {
+ (0, payment_id, required),
+ })
+ },
// Note that, going forward, all new events must only write data inside of
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
// data via `write_tlv_fields`.
// Note that, going forward, all new events must only write data inside of
// `write_tlv_fields`. Versions 0.0.101+ will ignore odd-numbered events that write
// data via `write_tlv_fields`.
@@
-1535,6
+1558,18
@@
impl MaybeReadable for Event {
};
f()
},
};
f()
},
+ #[cfg(invreqfailed)]
+ 33u8 => {
+ let f = || {
+ _init_and_read_len_prefixed_tlv_fields!(reader, {
+ (0, payment_id, required),
+ });
+ Ok(Some(Event::InvoiceRequestFailed {
+ payment_id: payment_id.0.unwrap(),
+ }))
+ };
+ f()
+ },
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
// reads.
// Versions prior to 0.0.100 did not ignore odd types, instead returning InvalidValue.
// Version 0.0.100 failed to properly ignore odd types, possibly resulting in corrupt
// reads.
@@
-1667,7
+1702,7
@@
pub enum MessageSendEvent {
/// The node_id of the node which should receive this message
node_id: PublicKey,
/// The message which should be sent.
/// The node_id of the node which should receive this message
node_id: PublicKey,
/// The message which should be sent.
- msg: msgs::TxA
ddInpu
t,
+ msg: msgs::TxA
bor
t,
},
/// Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
SendChannelReady {
},
/// Used to indicate that a channel_ready message should be sent to the peer with the given node_id.
SendChannelReady {