+ ChannelMessageHandler(const ChannelMessageHandler&) = delete;
+ ChannelMessageHandler(ChannelMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(ChannelMessageHandler)); }
+ ChannelMessageHandler(LDKChannelMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChannelMessageHandler)); }
+ operator LDKChannelMessageHandler() && { LDKChannelMessageHandler res = self; memset(&self, 0, sizeof(LDKChannelMessageHandler)); return res; }
+ ~ChannelMessageHandler() { ChannelMessageHandler_free(self); }
+ ChannelMessageHandler& operator=(ChannelMessageHandler&& o) { ChannelMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(ChannelMessageHandler)); return *this; }
+ LDKChannelMessageHandler* operator &() { return &self; }
+ LDKChannelMessageHandler* operator ->() { return &self; }
+ const LDKChannelMessageHandler* operator &() const { return &self; }
+ const LDKChannelMessageHandler* operator ->() const { return &self; }
+ /**
+ * Handle an incoming open_channel message from the given peer.
+ */
+ inline void handle_open_channel(struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg);
+ /**
+ * Handle an incoming accept_channel message from the given peer.
+ */
+ inline void handle_accept_channel(struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg);
+ /**
+ * Handle an incoming funding_created message from the given peer.
+ */
+ inline void handle_funding_created(struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg);
+ /**
+ * Handle an incoming funding_signed message from the given peer.
+ */
+ inline void handle_funding_signed(struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming channel_ready message from the given peer.
+ */
+ inline void handle_channel_ready(struct LDKPublicKey their_node_id, const struct LDKChannelReady *NONNULL_PTR msg);
+ /**
+ * Handle an incoming shutdown message from the given peer.
+ */
+ inline void handle_shutdown(struct LDKPublicKey their_node_id, const struct LDKInitFeatures *NONNULL_PTR their_features, const struct LDKShutdown *NONNULL_PTR msg);
+ /**
+ * Handle an incoming closing_signed message from the given peer.
+ */
+ inline void handle_closing_signed(struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming update_add_htlc message from the given peer.
+ */
+ inline void handle_update_add_htlc(struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming update_fulfill_htlc message from the given peer.
+ */
+ inline void handle_update_fulfill_htlc(struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming update_fail_htlc message from the given peer.
+ */
+ inline void handle_update_fail_htlc(struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming update_fail_malformed_htlc message from the given peer.
+ */
+ inline void handle_update_fail_malformed_htlc(struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg);
+ /**
+ * Handle an incoming commitment_signed message from the given peer.
+ */
+ inline void handle_commitment_signed(struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg);
+ /**
+ * Handle an incoming revoke_and_ack message from the given peer.
+ */
+ inline void handle_revoke_and_ack(struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg);
+ /**
+ * Handle an incoming update_fee message from the given peer.
+ */
+ inline void handle_update_fee(struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg);
+ /**
+ * Handle an incoming announcement_signatures message from the given peer.
+ */
+ inline void handle_announcement_signatures(struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg);
+ /**
+ * Indicates a connection to the peer failed/an existing connection was lost. If no connection
+ * is believed to be possible in the future (eg they're sending us messages we don't
+ * understand or indicate they require unknown feature bits), no_connection_possible is set
+ * and any outstanding channels should be failed.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
+ */
+ inline void peer_disconnected(struct LDKPublicKey their_node_id, bool no_connection_possible);
+ /**
+ * Handle a peer reconnecting, possibly generating channel_reestablish message(s).
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ inline LDK::CResult_NoneNoneZ peer_connected(struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg);
+ /**
+ * Handle an incoming channel_reestablish message from the given peer.
+ */
+ inline void handle_channel_reestablish(struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg);
+ /**
+ * Handle an incoming channel update from the given peer.
+ */
+ inline void handle_channel_update(struct LDKPublicKey their_node_id, const struct LDKChannelUpdate *NONNULL_PTR msg);
+ /**
+ * Handle an incoming error message from the given peer.
+ */
+ inline void handle_error(struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ inline LDK::NodeFeatures provided_node_features();
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ inline LDK::InitFeatures provided_init_features(struct LDKPublicKey their_node_id);
+};
+class RoutingMessageHandler {
+private:
+ LDKRoutingMessageHandler self;
+public:
+ RoutingMessageHandler(const RoutingMessageHandler&) = delete;
+ RoutingMessageHandler(RoutingMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(RoutingMessageHandler)); }
+ RoutingMessageHandler(LDKRoutingMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRoutingMessageHandler)); }
+ operator LDKRoutingMessageHandler() && { LDKRoutingMessageHandler res = self; memset(&self, 0, sizeof(LDKRoutingMessageHandler)); return res; }
+ ~RoutingMessageHandler() { RoutingMessageHandler_free(self); }
+ RoutingMessageHandler& operator=(RoutingMessageHandler&& o) { RoutingMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(RoutingMessageHandler)); return *this; }
+ LDKRoutingMessageHandler* operator &() { return &self; }
+ LDKRoutingMessageHandler* operator ->() { return &self; }
+ const LDKRoutingMessageHandler* operator &() const { return &self; }
+ const LDKRoutingMessageHandler* operator ->() const { return &self; }
+ /**
+ * Handle an incoming node_announcement message, returning true if it should be forwarded on,
+ * false or returning an Err otherwise.
+ */
+ inline LDK::CResult_boolLightningErrorZ handle_node_announcement(const struct LDKNodeAnnouncement *NONNULL_PTR msg);
+ /**
+ * Handle a channel_announcement message, returning true if it should be forwarded on, false
+ * or returning an Err otherwise.
+ */
+ inline LDK::CResult_boolLightningErrorZ handle_channel_announcement(const struct LDKChannelAnnouncement *NONNULL_PTR msg);
+ /**
+ * Handle an incoming channel_update message, returning true if it should be forwarded on,
+ * false or returning an Err otherwise.
+ */
+ inline LDK::CResult_boolLightningErrorZ handle_channel_update(const struct LDKChannelUpdate *NONNULL_PTR msg);
+ /**
+ * Gets channel announcements and updates required to dump our routing table to a remote node,
+ * starting at the short_channel_id indicated by starting_point and including announcements
+ * for a single channel.
+ */
+ inline LDK::COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcement(uint64_t starting_point);
+ /**
+ * Gets a node announcement required to dump our routing table to a remote node, starting at
+ * the node *after* the provided pubkey and including up to one announcement immediately
+ * higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
+ * If None is provided for starting_point, we start at the first node.
+ *
+ * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
+ * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ inline LDK::NodeAnnouncement get_next_node_announcement(struct LDKPublicKey starting_point);
+ /**
+ * Called when a connection is established with a peer. This can be used to
+ * perform routing table synchronization using a strategy defined by the
+ * implementor.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ inline LDK::CResult_NoneNoneZ peer_connected(struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
+ /**
+ * Handles the reply of a query we initiated to learn about channels
+ * for a given range of blocks. We can expect to receive one or more
+ * replies to a single query.
+ */
+ inline LDK::CResult_NoneLightningErrorZ handle_reply_channel_range(struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg);
+ /**
+ * Handles the reply of a query we initiated asking for routing gossip
+ * messages for a list of channels. We should receive this message when
+ * a node has completed its best effort to send us the pertaining routing
+ * gossip messages.
+ */
+ inline LDK::CResult_NoneLightningErrorZ handle_reply_short_channel_ids_end(struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg);
+ /**
+ * Handles when a peer asks us to send a list of short_channel_ids
+ * for the requested range of blocks.
+ */
+ inline LDK::CResult_NoneLightningErrorZ handle_query_channel_range(struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg);
+ /**
+ * Handles when a peer asks us to send routing gossip messages for a
+ * list of short_channel_ids.
+ */
+ inline LDK::CResult_NoneLightningErrorZ handle_query_short_channel_ids(struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ inline LDK::NodeFeatures provided_node_features();
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ inline LDK::InitFeatures provided_init_features(struct LDKPublicKey their_node_id);
+};
+class OnionMessageHandler {
+private:
+ LDKOnionMessageHandler self;
+public:
+ OnionMessageHandler(const OnionMessageHandler&) = delete;
+ OnionMessageHandler(OnionMessageHandler&& o) : self(o.self) { memset(&o, 0, sizeof(OnionMessageHandler)); }
+ OnionMessageHandler(LDKOnionMessageHandler&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKOnionMessageHandler)); }
+ operator LDKOnionMessageHandler() && { LDKOnionMessageHandler res = self; memset(&self, 0, sizeof(LDKOnionMessageHandler)); return res; }
+ ~OnionMessageHandler() { OnionMessageHandler_free(self); }
+ OnionMessageHandler& operator=(OnionMessageHandler&& o) { OnionMessageHandler_free(self); self = o.self; memset(&o, 0, sizeof(OnionMessageHandler)); return *this; }
+ LDKOnionMessageHandler* operator &() { return &self; }
+ LDKOnionMessageHandler* operator ->() { return &self; }
+ const LDKOnionMessageHandler* operator &() const { return &self; }
+ const LDKOnionMessageHandler* operator ->() const { return &self; }
+ /**
+ * Handle an incoming onion_message message from the given peer.
+ */
+ inline void handle_onion_message(struct LDKPublicKey peer_node_id, const struct LDKOnionMessage *NONNULL_PTR msg);
+ /**
+ * Called when a connection is established with a peer. Can be used to track which peers
+ * advertise onion message support and are online.
+ *
+ * May return an `Err(())` if the features the peer supports are not sufficient to communicate
+ * with us. Implementors should be somewhat conservative about doing so, however, as other
+ * message handlers may still wish to communicate with this peer.
+ */
+ inline LDK::CResult_NoneNoneZ peer_connected(struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init);
+ /**
+ * Indicates a connection to the peer failed/an existing connection was lost. Allows handlers to
+ * drop and refuse to forward onion messages to this peer.
+ *
+ * Note that in some rare cases this may be called without a corresponding
+ * [`Self::peer_connected`].
+ */
+ inline void peer_disconnected(struct LDKPublicKey their_node_id, bool no_connection_possible);
+ /**
+ * Gets the node feature flags which this handler itself supports. All available handlers are
+ * queried similarly and their feature flags are OR'd together to form the [`NodeFeatures`]
+ * which are broadcasted in our [`NodeAnnouncement`] message.
+ */
+ inline LDK::NodeFeatures provided_node_features();
+ /**
+ * Gets the init feature flags which should be sent to the given peer. All available handlers
+ * are queried similarly and their feature flags are OR'd together to form the [`InitFeatures`]
+ * which are sent in our [`Init`] message.
+ *
+ * Note that this method is called before [`Self::peer_connected`].
+ */
+ inline LDK::InitFeatures provided_init_features(struct LDKPublicKey their_node_id);
+};
+class GraphSyncError {
+private:
+ LDKGraphSyncError self;
+public:
+ GraphSyncError(const GraphSyncError&) = delete;
+ GraphSyncError(GraphSyncError&& o) : self(o.self) { memset(&o, 0, sizeof(GraphSyncError)); }
+ GraphSyncError(LDKGraphSyncError&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKGraphSyncError)); }
+ operator LDKGraphSyncError() && { LDKGraphSyncError res = self; memset(&self, 0, sizeof(LDKGraphSyncError)); return res; }
+ ~GraphSyncError() { GraphSyncError_free(self); }
+ GraphSyncError& operator=(GraphSyncError&& o) { GraphSyncError_free(self); self = o.self; memset(&o, 0, sizeof(GraphSyncError)); return *this; }
+ LDKGraphSyncError* operator &() { return &self; }
+ LDKGraphSyncError* operator ->() { return &self; }
+ const LDKGraphSyncError* operator &() const { return &self; }
+ const LDKGraphSyncError* operator ->() const { return &self; }
+};
+class Level {
+private:
+ LDKLevel self;
+public:
+ Level(const Level&) = delete;
+ Level(Level&& o) : self(o.self) { memset(&o, 0, sizeof(Level)); }
+ Level(LDKLevel&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLevel)); }
+ operator LDKLevel() && { LDKLevel res = self; memset(&self, 0, sizeof(LDKLevel)); return res; }
+ Level& operator=(Level&& o) { self = o.self; memset(&o, 0, sizeof(Level)); return *this; }
+ LDKLevel* operator &() { return &self; }
+ LDKLevel* operator ->() { return &self; }
+ const LDKLevel* operator &() const { return &self; }
+ const LDKLevel* operator ->() const { return &self; }
+};
+class Record {
+private:
+ LDKRecord self;
+public:
+ Record(const Record&) = delete;
+ Record(Record&& o) : self(o.self) { memset(&o, 0, sizeof(Record)); }
+ Record(LDKRecord&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKRecord)); }
+ operator LDKRecord() && { LDKRecord res = self; memset(&self, 0, sizeof(LDKRecord)); return res; }
+ ~Record() { Record_free(self); }
+ Record& operator=(Record&& o) { Record_free(self); self = o.self; memset(&o, 0, sizeof(Record)); return *this; }
+ LDKRecord* operator &() { return &self; }
+ LDKRecord* operator ->() { return &self; }
+ const LDKRecord* operator &() const { return &self; }
+ const LDKRecord* operator ->() const { return &self; }
+};
+class Logger {
+private:
+ LDKLogger self;
+public:
+ Logger(const Logger&) = delete;
+ Logger(Logger&& o) : self(o.self) { memset(&o, 0, sizeof(Logger)); }
+ Logger(LDKLogger&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLogger)); }
+ operator LDKLogger() && { LDKLogger res = self; memset(&self, 0, sizeof(LDKLogger)); return res; }
+ ~Logger() { Logger_free(self); }
+ Logger& operator=(Logger&& o) { Logger_free(self); self = o.self; memset(&o, 0, sizeof(Logger)); return *this; }
+ LDKLogger* operator &() { return &self; }
+ LDKLogger* operator ->() { return &self; }
+ const LDKLogger* operator &() const { return &self; }
+ const LDKLogger* operator ->() const { return &self; }
+ /**
+ * Logs the `Record`
+ */
+ inline void log(const struct LDKRecord *NONNULL_PTR record);
+};
+class FutureCallback {
+private:
+ LDKFutureCallback self;
+public:
+ FutureCallback(const FutureCallback&) = delete;
+ FutureCallback(FutureCallback&& o) : self(o.self) { memset(&o, 0, sizeof(FutureCallback)); }
+ FutureCallback(LDKFutureCallback&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFutureCallback)); }
+ operator LDKFutureCallback() && { LDKFutureCallback res = self; memset(&self, 0, sizeof(LDKFutureCallback)); return res; }
+ ~FutureCallback() { FutureCallback_free(self); }
+ FutureCallback& operator=(FutureCallback&& o) { FutureCallback_free(self); self = o.self; memset(&o, 0, sizeof(FutureCallback)); return *this; }
+ LDKFutureCallback* operator &() { return &self; }
+ LDKFutureCallback* operator ->() { return &self; }
+ const LDKFutureCallback* operator &() const { return &self; }
+ const LDKFutureCallback* operator ->() const { return &self; }
+ /**
+ * The method which is called.
+ */
+ inline void call();
+};
+class Future {
+private:
+ LDKFuture self;
+public:
+ Future(const Future&) = delete;
+ Future(Future&& o) : self(o.self) { memset(&o, 0, sizeof(Future)); }
+ Future(LDKFuture&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKFuture)); }
+ operator LDKFuture() && { LDKFuture res = self; memset(&self, 0, sizeof(LDKFuture)); return res; }
+ ~Future() { Future_free(self); }
+ Future& operator=(Future&& o) { Future_free(self); self = o.self; memset(&o, 0, sizeof(Future)); return *this; }
+ LDKFuture* operator &() { return &self; }
+ LDKFuture* operator ->() { return &self; }
+ const LDKFuture* operator &() const { return &self; }
+ const LDKFuture* operator ->() const { return &self; }
+};
+class MonitorUpdateId {
+private:
+ LDKMonitorUpdateId self;
+public:
+ MonitorUpdateId(const MonitorUpdateId&) = delete;
+ MonitorUpdateId(MonitorUpdateId&& o) : self(o.self) { memset(&o, 0, sizeof(MonitorUpdateId)); }
+ MonitorUpdateId(LDKMonitorUpdateId&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKMonitorUpdateId)); }
+ operator LDKMonitorUpdateId() && { LDKMonitorUpdateId res = self; memset(&self, 0, sizeof(LDKMonitorUpdateId)); return res; }
+ ~MonitorUpdateId() { MonitorUpdateId_free(self); }
+ MonitorUpdateId& operator=(MonitorUpdateId&& o) { MonitorUpdateId_free(self); self = o.self; memset(&o, 0, sizeof(MonitorUpdateId)); return *this; }
+ LDKMonitorUpdateId* operator &() { return &self; }
+ LDKMonitorUpdateId* operator ->() { return &self; }
+ const LDKMonitorUpdateId* operator &() const { return &self; }
+ const LDKMonitorUpdateId* operator ->() const { return &self; }
+};
+class Persist {
+private:
+ LDKPersist self;
+public:
+ Persist(const Persist&) = delete;
+ Persist(Persist&& o) : self(o.self) { memset(&o, 0, sizeof(Persist)); }
+ Persist(LDKPersist&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKPersist)); }
+ operator LDKPersist() && { LDKPersist res = self; memset(&self, 0, sizeof(LDKPersist)); return res; }
+ ~Persist() { Persist_free(self); }
+ Persist& operator=(Persist&& o) { Persist_free(self); self = o.self; memset(&o, 0, sizeof(Persist)); return *this; }
+ LDKPersist* operator &() { return &self; }
+ LDKPersist* operator ->() { return &self; }
+ const LDKPersist* operator &() const { return &self; }
+ const LDKPersist* operator ->() const { return &self; }
+ /**
+ * Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
+ * called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.
+ *
+ * The data can be stored any way you want, but the identifier provided by LDK is the
+ * channel's outpoint (and it is up to you to maintain a correct mapping between the outpoint
+ * and the stored channel data). Note that you **must** persist every new monitor to disk.
+ *
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
+ *
+ * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`
+ * and [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+ *
+ * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+ * [`Writeable::write`]: crate::util::ser::Writeable::write
+ */
+ inline LDK::ChannelMonitorUpdateStatus persist_new_channel(struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
+ /**
+ * Update one channel's data. The provided [`ChannelMonitor`] has already applied the given
+ * update.
+ *
+ * Note that on every update, you **must** persist either the [`ChannelMonitorUpdate`] or the
+ * updated monitor itself to disk/backups. See the [`Persist`] trait documentation for more
+ * details.
+ *
+ * During blockchain synchronization operations, this may be called with no
+ * [`ChannelMonitorUpdate`], in which case the full [`ChannelMonitor`] needs to be persisted.
+ * Note that after the full [`ChannelMonitor`] is persisted any previous
+ * [`ChannelMonitorUpdate`]s which were persisted should be discarded - they can no longer be
+ * applied to the persisted [`ChannelMonitor`] as they were already applied.
+ *
+ * If an implementer chooses to persist the updates only, they need to make
+ * sure that all the updates are applied to the `ChannelMonitors` *before*
+ * the set of channel monitors is given to the `ChannelManager`
+ * deserialization routine. See [`ChannelMonitor::update_monitor`] for
+ * applying a monitor update to a monitor. If full `ChannelMonitors` are
+ * persisted, then there is no need to persist individual updates.
+ *
+ * Note that there could be a performance tradeoff between persisting complete
+ * channel monitors on every update vs. persisting only updates and applying
+ * them in batches. The size of each monitor grows `O(number of state updates)`
+ * whereas updates are small and `O(1)`.
+ *
+ * The `update_id` is used to identify this call to [`ChainMonitor::channel_monitor_updated`],
+ * if you return [`ChannelMonitorUpdateStatus::InProgress`].
+ *
+ * See [`Writeable::write`] on [`ChannelMonitor`] for writing out a `ChannelMonitor`,
+ * [`Writeable::write`] on [`ChannelMonitorUpdate`] for writing out an update, and
+ * [`ChannelMonitorUpdateStatus`] for requirements when returning errors.
+ *
+ * [`Writeable::write`]: crate::util::ser::Writeable::write
+ *
+ * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None
+ */
+ inline LDK::ChannelMonitorUpdateStatus update_persisted_channel(struct LDKOutPoint channel_id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id);
+};
+class LockedChannelMonitor {
+private:
+ LDKLockedChannelMonitor self;
+public:
+ LockedChannelMonitor(const LockedChannelMonitor&) = delete;
+ LockedChannelMonitor(LockedChannelMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(LockedChannelMonitor)); }
+ LockedChannelMonitor(LDKLockedChannelMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLockedChannelMonitor)); }
+ operator LDKLockedChannelMonitor() && { LDKLockedChannelMonitor res = self; memset(&self, 0, sizeof(LDKLockedChannelMonitor)); return res; }
+ ~LockedChannelMonitor() { LockedChannelMonitor_free(self); }
+ LockedChannelMonitor& operator=(LockedChannelMonitor&& o) { LockedChannelMonitor_free(self); self = o.self; memset(&o, 0, sizeof(LockedChannelMonitor)); return *this; }
+ LDKLockedChannelMonitor* operator &() { return &self; }
+ LDKLockedChannelMonitor* operator ->() { return &self; }
+ const LDKLockedChannelMonitor* operator &() const { return &self; }
+ const LDKLockedChannelMonitor* operator ->() const { return &self; }
+};
+class ChainMonitor {
+private:
+ LDKChainMonitor self;
+public:
+ ChainMonitor(const ChainMonitor&) = delete;
+ ChainMonitor(ChainMonitor&& o) : self(o.self) { memset(&o, 0, sizeof(ChainMonitor)); }
+ ChainMonitor(LDKChainMonitor&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKChainMonitor)); }
+ operator LDKChainMonitor() && { LDKChainMonitor res = self; memset(&self, 0, sizeof(LDKChainMonitor)); return res; }
+ ~ChainMonitor() { ChainMonitor_free(self); }
+ ChainMonitor& operator=(ChainMonitor&& o) { ChainMonitor_free(self); self = o.self; memset(&o, 0, sizeof(ChainMonitor)); return *this; }
+ LDKChainMonitor* operator &() { return &self; }
+ LDKChainMonitor* operator ->() { return &self; }
+ const LDKChainMonitor* operator &() const { return &self; }
+ const LDKChainMonitor* operator ->() const { return &self; }
+};
+class CResult_LockedChannelMonitorNoneZ {
+private:
+ LDKCResult_LockedChannelMonitorNoneZ self;
+public:
+ CResult_LockedChannelMonitorNoneZ(const CResult_LockedChannelMonitorNoneZ&) = delete;
+ CResult_LockedChannelMonitorNoneZ(CResult_LockedChannelMonitorNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_LockedChannelMonitorNoneZ)); }
+ CResult_LockedChannelMonitorNoneZ(LDKCResult_LockedChannelMonitorNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_LockedChannelMonitorNoneZ)); }
+ operator LDKCResult_LockedChannelMonitorNoneZ() && { LDKCResult_LockedChannelMonitorNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_LockedChannelMonitorNoneZ)); return res; }
+ ~CResult_LockedChannelMonitorNoneZ() { CResult_LockedChannelMonitorNoneZ_free(self); }
+ CResult_LockedChannelMonitorNoneZ& operator=(CResult_LockedChannelMonitorNoneZ&& o) { CResult_LockedChannelMonitorNoneZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_LockedChannelMonitorNoneZ)); return *this; }
+ LDKCResult_LockedChannelMonitorNoneZ* operator &() { return &self; }
+ LDKCResult_LockedChannelMonitorNoneZ* operator ->() { return &self; }
+ const LDKCResult_LockedChannelMonitorNoneZ* operator &() const { return &self; }
+ const LDKCResult_LockedChannelMonitorNoneZ* operator ->() const { return &self; }
+};
+class CResult_PhantomRouteHintsDecodeErrorZ {
+private:
+ LDKCResult_PhantomRouteHintsDecodeErrorZ self;
+public:
+ CResult_PhantomRouteHintsDecodeErrorZ(const CResult_PhantomRouteHintsDecodeErrorZ&) = delete;
+ CResult_PhantomRouteHintsDecodeErrorZ(CResult_PhantomRouteHintsDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PhantomRouteHintsDecodeErrorZ)); }
+ CResult_PhantomRouteHintsDecodeErrorZ(LDKCResult_PhantomRouteHintsDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ)); }
+ operator LDKCResult_PhantomRouteHintsDecodeErrorZ() && { LDKCResult_PhantomRouteHintsDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ)); return res; }
+ ~CResult_PhantomRouteHintsDecodeErrorZ() { CResult_PhantomRouteHintsDecodeErrorZ_free(self); }
+ CResult_PhantomRouteHintsDecodeErrorZ& operator=(CResult_PhantomRouteHintsDecodeErrorZ&& o) { CResult_PhantomRouteHintsDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_PhantomRouteHintsDecodeErrorZ)); return *this; }
+ LDKCResult_PhantomRouteHintsDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_PhantomRouteHintsDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_PhantomRouteHintsDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_PhantomRouteHintsDecodeErrorZ* operator ->() const { return &self; }
+};
+class CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ {
+private:
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ self;
+public:
+ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ(const CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ&) = delete;
+ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ(CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ)); }
+ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ)); }
+ operator LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ() && { LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ)); return res; }
+ ~CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ() { CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(self); }
+ CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ& operator=(CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ&& o) { CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ)); return *this; }
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* operator &() { return &self; }
+ LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* operator ->() { return &self; }
+ const LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* operator &() const { return &self; }
+ const LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* operator ->() const { return &self; }
+};
+class CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ {
+private:
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ self;
+public:
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(const CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&) = delete;
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); }
+ operator LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ() && { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); return res; }
+ ~CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ() { CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(self); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ& operator=(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ&& o) { CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ)); return *this; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator &() { return &self; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator ->() { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator &() const { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ* operator ->() const { return &self; }
+};
+class CVec_C2Tuple_u32TxOutZZ {
+private:
+ LDKCVec_C2Tuple_u32TxOutZZ self;
+public:
+ CVec_C2Tuple_u32TxOutZZ(const CVec_C2Tuple_u32TxOutZZ&) = delete;
+ CVec_C2Tuple_u32TxOutZZ(CVec_C2Tuple_u32TxOutZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_u32TxOutZZ)); }
+ CVec_C2Tuple_u32TxOutZZ(LDKCVec_C2Tuple_u32TxOutZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_u32TxOutZZ)); }
+ operator LDKCVec_C2Tuple_u32TxOutZZ() && { LDKCVec_C2Tuple_u32TxOutZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_u32TxOutZZ)); return res; }
+ ~CVec_C2Tuple_u32TxOutZZ() { CVec_C2Tuple_u32TxOutZZ_free(self); }
+ CVec_C2Tuple_u32TxOutZZ& operator=(CVec_C2Tuple_u32TxOutZZ&& o) { CVec_C2Tuple_u32TxOutZZ_free(self); self = o.self; memset(&o, 0, sizeof(CVec_C2Tuple_u32TxOutZZ)); return *this; }
+ LDKCVec_C2Tuple_u32TxOutZZ* operator &() { return &self; }
+ LDKCVec_C2Tuple_u32TxOutZZ* operator ->() { return &self; }
+ const LDKCVec_C2Tuple_u32TxOutZZ* operator &() const { return &self; }
+ const LDKCVec_C2Tuple_u32TxOutZZ* operator ->() const { return &self; }
+};
+class CResult_FundingCreatedDecodeErrorZ {
+private:
+ LDKCResult_FundingCreatedDecodeErrorZ self;
+public:
+ CResult_FundingCreatedDecodeErrorZ(const CResult_FundingCreatedDecodeErrorZ&) = delete;
+ CResult_FundingCreatedDecodeErrorZ(CResult_FundingCreatedDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_FundingCreatedDecodeErrorZ)); }
+ CResult_FundingCreatedDecodeErrorZ(LDKCResult_FundingCreatedDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_FundingCreatedDecodeErrorZ)); }
+ operator LDKCResult_FundingCreatedDecodeErrorZ() && { LDKCResult_FundingCreatedDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_FundingCreatedDecodeErrorZ)); return res; }
+ ~CResult_FundingCreatedDecodeErrorZ() { CResult_FundingCreatedDecodeErrorZ_free(self); }
+ CResult_FundingCreatedDecodeErrorZ& operator=(CResult_FundingCreatedDecodeErrorZ&& o) { CResult_FundingCreatedDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_FundingCreatedDecodeErrorZ)); return *this; }
+ LDKCResult_FundingCreatedDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_FundingCreatedDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_FundingCreatedDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_FundingCreatedDecodeErrorZ* operator ->() const { return &self; }
+};
+class CResult_ChannelInfoDecodeErrorZ {
+private:
+ LDKCResult_ChannelInfoDecodeErrorZ self;
+public:
+ CResult_ChannelInfoDecodeErrorZ(const CResult_ChannelInfoDecodeErrorZ&) = delete;
+ CResult_ChannelInfoDecodeErrorZ(CResult_ChannelInfoDecodeErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_ChannelInfoDecodeErrorZ)); }
+ CResult_ChannelInfoDecodeErrorZ(LDKCResult_ChannelInfoDecodeErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_ChannelInfoDecodeErrorZ)); }
+ operator LDKCResult_ChannelInfoDecodeErrorZ() && { LDKCResult_ChannelInfoDecodeErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_ChannelInfoDecodeErrorZ)); return res; }
+ ~CResult_ChannelInfoDecodeErrorZ() { CResult_ChannelInfoDecodeErrorZ_free(self); }
+ CResult_ChannelInfoDecodeErrorZ& operator=(CResult_ChannelInfoDecodeErrorZ&& o) { CResult_ChannelInfoDecodeErrorZ_free(self); self = o.self; memset(&o, 0, sizeof(CResult_ChannelInfoDecodeErrorZ)); return *this; }
+ LDKCResult_ChannelInfoDecodeErrorZ* operator &() { return &self; }
+ LDKCResult_ChannelInfoDecodeErrorZ* operator ->() { return &self; }
+ const LDKCResult_ChannelInfoDecodeErrorZ* operator &() const { return &self; }
+ const LDKCResult_ChannelInfoDecodeErrorZ* operator ->() const { return &self; }