* `data_is_owned` either set or unset at your discretion.
*/
typedef struct LDKTransaction {
- const uint8_t *data;
+ /**
+ * This is non-const for your convenience, an object passed to Rust is never written to.
+ */
+ uint8_t *data;
uintptr_t datalen;
bool data_is_owned;
} LDKTransaction;
} LDKTxOut;
typedef struct LDKC2TupleTempl_usize__Transaction {
- uintptr_t *a;
- LDKTransaction *b;
+ uintptr_t a;
+ LDKTransaction b;
} LDKC2TupleTempl_usize__Transaction;
typedef LDKC2TupleTempl_usize__Transaction LDKC2Tuple_usizeTransactionZ;
* inconsistent with the ChannelMonitor being called. eg for ChannelMonitor::update_monitor this
* means you tried to update a monitor for a different channel or the ChannelMonitorUpdate was
* corrupted.
- * Contains a human-readable error message.
+ * Contains a developer-readable error message.
*/
typedef struct MUST_USE_STRUCT LDKMonitorUpdateError {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeMonitorUpdateError *inner;
*/
typedef struct MUST_USE_STRUCT LDKOutPoint {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeOutPoint *inner;
} LDKOutPoint;
typedef struct LDKC2TupleTempl_OutPoint__CVec_u8Z {
- LDKOutPoint *a;
- LDKCVec_u8Z *b;
+ LDKOutPoint a;
+ LDKCVec_u8Z b;
} LDKC2TupleTempl_OutPoint__CVec_u8Z;
typedef LDKC2TupleTempl_OutPoint__CVec_u8Z LDKC2Tuple_OutPointScriptZ;
+typedef struct LDKC2TupleTempl_u32__TxOut {
+ uint32_t a;
+ LDKTxOut b;
+} LDKC2TupleTempl_u32__TxOut;
+
+typedef LDKC2TupleTempl_u32__TxOut LDKC2Tuple_u32TxOutZ;
+
/**
* Arbitrary 32 bytes, which could represent one of a few different things. You probably want to
* look up the corresponding function in rust-lightning's docs.
uint8_t data[32];
} LDKThirtyTwoBytes;
-typedef struct LDKCVecTempl_TxOut {
- LDKTxOut *data;
+typedef struct LDKCVecTempl_C2TupleTempl_u32__TxOut {
+ LDKC2TupleTempl_u32__TxOut *data;
uintptr_t datalen;
-} LDKCVecTempl_TxOut;
+} LDKCVecTempl_C2TupleTempl_u32__TxOut;
-typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut {
- LDKThirtyTwoBytes *a;
- LDKCVecTempl_TxOut *b;
-} LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut;
+typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
+ LDKThirtyTwoBytes a;
+ LDKCVecTempl_C2TupleTempl_u32__TxOut b;
+} LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut;
-typedef LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut LDKC2Tuple_TxidCVec_TxOutZZ;
+typedef LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ;
-typedef LDKCVecTempl_TxOut LDKCVec_TxOutZ;
+typedef LDKCVecTempl_C2TupleTempl_u32__TxOut LDKCVec_C2Tuple_u32TxOutZZ;
typedef struct LDKC2TupleTempl_u64__u64 {
- uint64_t *a;
- uint64_t *b;
+ uint64_t a;
+ uint64_t b;
} LDKC2TupleTempl_u64__u64;
typedef LDKC2TupleTempl_u64__u64 LDKC2Tuple_u64u64Z;
} LDKCVecTempl_Signature;
typedef struct LDKC2TupleTempl_Signature__CVecTempl_Signature {
- LDKSignature *a;
- LDKCVecTempl_Signature *b;
+ LDKSignature a;
+ LDKCVecTempl_Signature b;
} LDKC2TupleTempl_Signature__CVecTempl_Signature;
typedef LDKC2TupleTempl_Signature__CVecTempl_Signature LDKC2Tuple_SignatureCVec_SignatureZZ;
*/
typedef struct MUST_USE_STRUCT LDKPaymentSendFailure {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePaymentSendFailure *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelAnnouncement {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelAnnouncement *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelUpdate {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelUpdate *inner;
} LDKChannelUpdate;
typedef struct LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate {
- LDKChannelAnnouncement *a;
- LDKChannelUpdate *b;
- LDKChannelUpdate *c;
+ LDKChannelAnnouncement a;
+ LDKChannelUpdate b;
+ LDKChannelUpdate c;
} LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate;
typedef LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ;
*/
typedef struct MUST_USE_STRUCT LDKPeerHandleError {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePeerHandleError *inner;
*/
typedef struct MUST_USE_STRUCT LDKHTLCOutputInCommitment {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHTLCOutputInCommitment *inner;
} LDKHTLCOutputInCommitment;
typedef struct LDKC2TupleTempl_HTLCOutputInCommitment__Signature {
- LDKHTLCOutputInCommitment *a;
- LDKSignature *b;
+ LDKHTLCOutputInCommitment a;
+ LDKSignature b;
} LDKC2TupleTempl_HTLCOutputInCommitment__Signature;
typedef LDKC2TupleTempl_HTLCOutputInCommitment__Signature LDKC2Tuple_HTLCOutputInCommitmentSignatureZ;
+
+
+/**
+ * An Err type for failure to process messages.
+ */
+typedef struct MUST_USE_STRUCT LDKLightningError {
+ /**
+ * Nearly everywhere, inner must be non-null, however in places where
+ * the Rust equivalent takes an Option, it may be set to null to indicate None.
+ */
+ LDKnativeLightningError *inner;
+ bool is_owned;
+} LDKLightningError;
+
+typedef union LDKCResultPtr_u8__LightningError {
+ uint8_t *result;
+ LDKLightningError *err;
+} LDKCResultPtr_u8__LightningError;
+
+typedef struct LDKCResultTempl_u8__LightningError {
+ LDKCResultPtr_u8__LightningError contents;
+ bool result_ok;
+} LDKCResultTempl_u8__LightningError;
+
+typedef LDKCResultTempl_u8__LightningError LDKCResult_NoneLightningErrorZ;
+
typedef struct LDKPublicKey {
uint8_t compressed_form[33];
} LDKPublicKey;
*/
typedef struct MUST_USE_STRUCT LDKAcceptChannel {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeAcceptChannel *inner;
*/
typedef struct MUST_USE_STRUCT LDKOpenChannel {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeOpenChannel *inner;
*/
typedef struct MUST_USE_STRUCT LDKFundingCreated {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingCreated *inner;
*/
typedef struct MUST_USE_STRUCT LDKFundingSigned {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingSigned *inner;
*/
typedef struct MUST_USE_STRUCT LDKFundingLocked {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeFundingLocked *inner;
*/
typedef struct MUST_USE_STRUCT LDKAnnouncementSignatures {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeAnnouncementSignatures *inner;
*/
typedef struct MUST_USE_STRUCT LDKCommitmentUpdate {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCommitmentUpdate *inner;
*/
typedef struct MUST_USE_STRUCT LDKRevokeAndACK {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRevokeAndACK *inner;
*/
typedef struct MUST_USE_STRUCT LDKClosingSigned {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeClosingSigned *inner;
*/
typedef struct MUST_USE_STRUCT LDKShutdown {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeShutdown *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelReestablish {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelReestablish *inner;
*/
typedef struct MUST_USE_STRUCT LDKNodeAnnouncement {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeAnnouncement *inner;
*/
typedef struct MUST_USE_STRUCT LDKErrorMessage {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeErrorMessage *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelHandshakeConfig {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelHandshakeConfig *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelHandshakeLimits {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelHandshakeLimits *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelConfig {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelConfig *inner;
*/
typedef struct MUST_USE_STRUCT LDKUserConfig {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUserConfig *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelPublicKeys {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelPublicKeys *inner;
*/
typedef struct MUST_USE_STRUCT LDKPreCalculatedTxCreationKeys {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePreCalculatedTxCreationKeys *inner;
*/
typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHolderCommitmentTransaction *inner;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedChannelAnnouncement {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedChannelAnnouncement *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelMonitor {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelMonitor *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelMonitorUpdate {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelMonitorUpdate *inner;
*/
typedef struct MUST_USE_STRUCT LDKMonitorEvent {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeMonitorEvent *inner;
void (*free)(void *this_arg);
} LDKFeeEstimator;
+/**
+ * `Persist` defines behavior for persisting channel monitors: this could mean
+ * writing once to disk, and/or uploading to one or more backup services.
+ *
+ * Note that for every new monitor, you **must** persist the new `ChannelMonitor`
+ * to disk/backups. And, on every update, you **must** persist either the
+ * `ChannelMonitorUpdate` or the updated monitor itself. Otherwise, there is risk
+ * of situations such as revoking a transaction, then crashing before this
+ * revocation can be persisted, then unintentionally broadcasting a revoked
+ * transaction and losing money. This is a risk because previous channel states
+ * are toxic, so it's important that whatever channel state is persisted is
+ * kept up-to-date.
+ */
+typedef struct LDKPersist {
+ void *this_arg;
+ /**
+ * Persist a new channel's data. The data can be stored any way you want, but
+ * the identifier provided by Rust-Lightning 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. See the `Persist` trait documentation for more details.
+ *
+ * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * and [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ *
+ * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
+ * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
+ */
+ LDKCResult_NoneChannelMonitorUpdateErrZ (*persist_new_channel)(const void *this_arg, LDKOutPoint id, const LDKChannelMonitor *data);
+ /**
+ * 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.
+ *
+ * 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)`.
+ *
+ * See [`ChannelMonitor::serialize_for_disk`] for writing out a `ChannelMonitor`,
+ * [`ChannelMonitorUpdate::write`] for writing out an update, and
+ * [`ChannelMonitorUpdateErr`] for requirements when returning errors.
+ *
+ * [`ChannelMonitor::update_monitor`]: struct.ChannelMonitor.html#impl-1
+ * [`ChannelMonitor::serialize_for_disk`]: struct.ChannelMonitor.html#method.serialize_for_disk
+ * [`ChannelMonitorUpdate::write`]: struct.ChannelMonitorUpdate.html#method.write
+ * [`ChannelMonitorUpdateErr`]: enum.ChannelMonitorUpdateErr.html
+ */
+ LDKCResult_NoneChannelMonitorUpdateErrZ (*update_persisted_channel)(const void *this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate *update, const LDKChannelMonitor *data);
+ void (*free)(void *this_arg);
+} LDKPersist;
+
/**
*/
typedef struct MUST_USE_STRUCT LDKChainMonitor {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChainMonitor *inner;
*/
typedef struct MUST_USE_STRUCT LDKHTLCUpdate {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeHTLCUpdate *inner;
typedef LDKCVecTempl_Transaction LDKCVec_TransactionZ;
-typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut {
- LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *data;
+typedef struct LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
+ LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut *data;
uintptr_t datalen;
-} LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut;
+} LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut;
-typedef LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut LDKCVec_C2Tuple_TxidCVec_TxOutZZZ;
+typedef LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ;
typedef struct LDKSecretKey {
uint8_t bytes[32];
*/
typedef struct MUST_USE_STRUCT LDKInMemoryChannelKeys {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInMemoryChannelKeys *inner;
*/
typedef struct MUST_USE_STRUCT LDKKeysManager {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeKeysManager *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelManager {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelManager *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelDetails {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelDetails *inner;
*/
typedef struct MUST_USE_STRUCT LDKInitFeatures {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInitFeatures *inner;
*/
typedef struct MUST_USE_STRUCT LDKRoute {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRoute *inner;
*/
typedef struct MUST_USE_STRUCT LDKUpdateAddHTLC {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateAddHTLC *inner;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFulfillHTLC {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFulfillHTLC *inner;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFailHTLC {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFailHTLC *inner;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFailMalformedHTLC {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFailMalformedHTLC *inner;
*/
typedef struct MUST_USE_STRUCT LDKCommitmentSigned {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeCommitmentSigned *inner;
*/
typedef struct MUST_USE_STRUCT LDKUpdateFee {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUpdateFee *inner;
*/
typedef struct MUST_USE_STRUCT LDKInit {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeInit *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelManagerReadArgs {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelManagerReadArgs *inner;
*/
typedef struct MUST_USE_STRUCT LDKDecodeError {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDecodeError *inner;
*/
typedef struct MUST_USE_STRUCT LDKPing {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePing *inner;
*/
typedef struct MUST_USE_STRUCT LDKPong {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePong *inner;
*/
typedef struct MUST_USE_STRUCT LDKDataLossProtect {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDataLossProtect *inner;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedNodeAnnouncement {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedNodeAnnouncement *inner;
*/
typedef struct MUST_USE_STRUCT LDKNodeFeatures {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeFeatures *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelFeatures {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelFeatures *inner;
*/
typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeUnsignedChannelUpdate *inner;
*/
typedef struct MUST_USE_STRUCT LDKQueryChannelRange {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeQueryChannelRange *inner;
*/
typedef struct MUST_USE_STRUCT LDKReplyChannelRange {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeReplyChannelRange *inner;
*/
typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeQueryShortChannelIds *inner;
*/
typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeReplyShortChannelIdsEnd *inner;
*/
typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeGossipTimestampFilter *inner;
bool is_owned;
} LDKGossipTimestampFilter;
-
-
-/**
- * An Err type for failure to process messages.
- */
-typedef struct MUST_USE_STRUCT LDKLightningError {
- /**
- * Nearly everyhwere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeLightningError *inner;
- bool is_owned;
-} LDKLightningError;
-
typedef struct LDKCVecTempl_UpdateAddHTLC {
LDKUpdateAddHTLC *data;
uintptr_t datalen;
*/
typedef struct MUST_USE_STRUCT LDKMessageHandler {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeMessageHandler *inner;
* socket_disconnected but prior to socket_disconnected returning.
*/
void (*disconnect_socket)(void *this_arg);
- bool (*eq)(const void *this_arg, const void *other_arg);
+ bool (*eq)(const void *this_arg, const LDKSocketDescriptor *other_arg);
uint64_t (*hash)(const void *this_arg);
void *(*clone)(const void *this_arg);
void (*free)(void *this_arg);
*/
typedef struct MUST_USE_STRUCT LDKPeerManager {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativePeerManager *inner;
*/
typedef struct MUST_USE_STRUCT LDKTxCreationKeys {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeTxCreationKeys *inner;
*/
typedef struct MUST_USE_STRUCT LDKRouteHop {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRouteHop *inner;
*/
typedef struct MUST_USE_STRUCT LDKRouteHint {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRouteHint *inner;
*/
typedef struct MUST_USE_STRUCT LDKRoutingFees {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeRoutingFees *inner;
*/
typedef struct MUST_USE_STRUCT LDKNetworkGraph {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNetworkGraph *inner;
*/
typedef struct MUST_USE_STRUCT LDKLockedNetworkGraph {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeLockedNetworkGraph *inner;
*/
typedef struct MUST_USE_STRUCT LDKNetGraphMsgHandler {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNetGraphMsgHandler *inner;
*/
typedef struct MUST_USE_STRUCT LDKDirectionalChannelInfo {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeDirectionalChannelInfo *inner;
*/
typedef struct MUST_USE_STRUCT LDKChannelInfo {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeChannelInfo *inner;
*/
typedef struct MUST_USE_STRUCT LDKNodeAnnouncementInfo {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeAnnouncementInfo *inner;
*/
typedef struct MUST_USE_STRUCT LDKNodeInfo {
/**
- * Nearly everyhwere, inner must be non-null, however in places where
+ * Nearly everywhere, inner must be non-null, however in places where
* the Rust equivalent takes an Option, it may be set to null to indicate None.
*/
LDKnativeNodeInfo *inner;
extern const void (*C2Tuple_SignatureCVec_SignatureZZ_free)(LDKC2Tuple_SignatureCVec_SignatureZZ);
-extern const void (*C2Tuple_TxidCVec_TxOutZZ_free)(LDKC2Tuple_TxidCVec_TxOutZZ);
+extern const void (*C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free)(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ);
+
+extern const void (*C2Tuple_u32TxOutZ_free)(LDKC2Tuple_u32TxOutZ);
extern const void (*C2Tuple_u64u64Z_free)(LDKC2Tuple_u64u64Z);
extern const void (*C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free)(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ);
+extern const uint64_t CLOSED_CHANNEL_UPDATE_ID;
+
extern const void (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free)(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ);
extern const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok)(LDKC2Tuple_SignatureCVec_SignatureZZ);
extern const void (*CResult_NoneChannelMonitorUpdateErrZ_free)(LDKCResult_NoneChannelMonitorUpdateErrZ);
+extern const LDKCResult_NoneLightningErrorZ (*CResult_NoneLightningErrorZ_err)(LDKLightningError);
+
+extern const void (*CResult_NoneLightningErrorZ_free)(LDKCResult_NoneLightningErrorZ);
+
extern const LDKCResult_NoneMonitorUpdateErrorZ (*CResult_NoneMonitorUpdateErrorZ_err)(LDKMonitorUpdateError);
extern const void (*CResult_NoneMonitorUpdateErrorZ_free)(LDKCResult_NoneMonitorUpdateErrorZ);
extern const void (*CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free)(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ);
-extern const void (*CVec_C2Tuple_TxidCVec_TxOutZZZ_free)(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ);
+extern const void (*CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free)(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ);
+
+extern const void (*CVec_C2Tuple_u32TxOutZZ_free)(LDKCVec_C2Tuple_u32TxOutZZ);
extern const void (*CVec_C2Tuple_usizeTransactionZZ_free)(LDKCVec_C2Tuple_usizeTransactionZZ);
extern const void (*CVec_TransactionZ_free)(LDKCVec_TransactionZ);
-extern const void (*CVec_TxOutZ_free)(LDKCVec_TxOutZ);
-
extern const void (*CVec_UpdateAddHTLCZ_free)(LDKCVec_UpdateAddHTLCZ);
extern const void (*CVec_UpdateFailHTLCZ_free)(LDKCVec_UpdateFailHTLCZ);
LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(LDKOutPoint a, LDKCVec_u8Z b);
-LDKC2Tuple_TxidCVec_TxOutZZ C2Tuple_TxidCVec_TxOutZZ_new(LDKThirtyTwoBytes a, LDKCVec_TxOutZ b);
+LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, LDKTxOut b);
+
+LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(LDKThirtyTwoBytes a, LDKCVec_C2Tuple_u32TxOutZZ b);
LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b);
LDKC2Tuple_HTLCOutputInCommitmentSignatureZ C2Tuple_HTLCOutputInCommitmentSignatureZ_new(LDKHTLCOutputInCommitment a, LDKSignature b);
+LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void);
+
void Event_free(LDKEvent this_ptr);
+LDKEvent Event_clone(const LDKEvent *orig);
+
void MessageSendEvent_free(LDKMessageSendEvent this_ptr);
+LDKMessageSendEvent MessageSendEvent_clone(const LDKMessageSendEvent *orig);
+
/**
* Calls the free function if one is set
*/
void APIError_free(LDKAPIError this_ptr);
+LDKAPIError APIError_clone(const LDKAPIError *orig);
+
+LDKLevel Level_clone(const LDKLevel *orig);
+
/**
* Returns the most verbose logging level.
*/
void ChannelHandshakeConfig_free(LDKChannelHandshakeConfig this_ptr);
+LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const LDKChannelHandshakeConfig *orig);
+
/**
* Confirmations we will wait for before considering the channel locked in.
* Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
void ChannelHandshakeLimits_free(LDKChannelHandshakeLimits this_ptr);
+LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const LDKChannelHandshakeLimits *orig);
+
/**
* Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
* only applies to inbound channels.
void ChannelConfig_free(LDKChannelConfig this_ptr);
+LDKChannelConfig ChannelConfig_clone(const LDKChannelConfig *orig);
+
/**
* Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
* This may be allowed to change at runtime in a later update, however doing so must result in
void UserConfig_free(LDKUserConfig this_ptr);
+LDKUserConfig UserConfig_clone(const LDKUserConfig *orig);
+
/**
* Channel config that we propose to our counterparty.
*/
MUST_USE_RES LDKUserConfig UserConfig_default(void);
+LDKAccessError AccessError_clone(const LDKAccessError *orig);
+
/**
* Calls the free function if one is set
*/
*/
void BroadcasterInterface_free(LDKBroadcasterInterface this_ptr);
+LDKConfirmationTarget ConfirmationTarget_clone(const LDKConfirmationTarget *orig);
+
/**
* Calls the free function if one is set
*/
*
* [`chain::Filter`]: ../trait.Filter.html
*/
-MUST_USE_RES LDKChainMonitor ChainMonitor_new(LDKFilter *chain_source, LDKBroadcasterInterface broadcaster, LDKLogger logger, LDKFeeEstimator feeest);
+MUST_USE_RES LDKChainMonitor ChainMonitor_new(LDKFilter *chain_source, LDKBroadcasterInterface broadcaster, LDKLogger logger, LDKFeeEstimator feeest, LDKPersist persister);
LDKWatch ChainMonitor_as_Watch(const LDKChainMonitor *this_arg);
void ChannelMonitorUpdate_free(LDKChannelMonitorUpdate this_ptr);
+LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const LDKChannelMonitorUpdate *orig);
+
/**
* The sequence number of this update. Updates *must* be replayed in-order according to this
* sequence number (and updates may panic if they are not). The update_id values are strictly
- * increasing and increase by one for each new update.
+ * increasing and increase by one for each new update, with one exception specified below.
*
* This sequence number is also used to track up to which points updates which returned
* ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
* ChannelMonitor when ChannelManager::channel_monitor_updated is called.
+ *
+ * The only instance where update_id values are not strictly increasing is the case where we
+ * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
+ * its docs for more details.
+ *
+ * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
*/
uint64_t ChannelMonitorUpdate_get_update_id(const LDKChannelMonitorUpdate *this_ptr);
/**
* The sequence number of this update. Updates *must* be replayed in-order according to this
* sequence number (and updates may panic if they are not). The update_id values are strictly
- * increasing and increase by one for each new update.
+ * increasing and increase by one for each new update, with one exception specified below.
*
* This sequence number is also used to track up to which points updates which returned
* ChannelMonitorUpdateErr::TemporaryFailure have been applied to all copies of a given
* ChannelMonitor when ChannelManager::channel_monitor_updated is called.
+ *
+ * The only instance where update_id values are not strictly increasing is the case where we
+ * allow post-force-close updates with a special update ID of [`CLOSED_CHANNEL_UPDATE_ID`]. See
+ * its docs for more details.
+ *
+ * [`CLOSED_CHANNEL_UPDATE_ID`]: constant.CLOSED_CHANNEL_UPDATE_ID.html
*/
void ChannelMonitorUpdate_set_update_id(LDKChannelMonitorUpdate *this_ptr, uint64_t val);
LDKChannelMonitorUpdate ChannelMonitorUpdate_read(LDKu8slice ser);
+LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const LDKChannelMonitorUpdateErr *orig);
+
void MonitorUpdateError_free(LDKMonitorUpdateError this_ptr);
void MonitorEvent_free(LDKMonitorEvent this_ptr);
+LDKMonitorEvent MonitorEvent_clone(const LDKMonitorEvent *orig);
+
void HTLCUpdate_free(LDKHTLCUpdate this_ptr);
+LDKHTLCUpdate HTLCUpdate_clone(const LDKHTLCUpdate *orig);
+
LDKCVec_u8Z HTLCUpdate_write(const LDKHTLCUpdate *obj);
LDKHTLCUpdate HTLCUpdate_read(LDKu8slice ser);
*
* panics if the given update is not the next update by update_id.
*/
-MUST_USE_RES LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(LDKChannelMonitor *this_arg, LDKChannelMonitorUpdate updates, const LDKBroadcasterInterface *broadcaster, const LDKLogger *logger);
+MUST_USE_RES LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(LDKChannelMonitor *this_arg, const LDKChannelMonitorUpdate *updates, const LDKBroadcasterInterface *broadcaster, const LDKFeeEstimator *fee_estimator, const LDKLogger *logger);
/**
* Gets the update_id from the latest ChannelMonitorUpdate which was applied to this
*
* [`get_outputs_to_watch`]: #method.get_outputs_to_watch
*/
-MUST_USE_RES LDKCVec_C2Tuple_TxidCVec_TxOutZZZ ChannelMonitor_block_connected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger);
+MUST_USE_RES LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger);
/**
* Determines if the disconnected block contained any transactions of interest and updates
*/
void ChannelMonitor_block_disconnected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger);
+/**
+ * Calls the free function if one is set
+ */
+void Persist_free(LDKPersist this_ptr);
+
void OutPoint_free(LDKOutPoint this_ptr);
+LDKOutPoint OutPoint_clone(const LDKOutPoint *orig);
+
/**
* The referenced transaction's txid.
*/
void SpendableOutputDescriptor_free(LDKSpendableOutputDescriptor this_ptr);
+LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const LDKSpendableOutputDescriptor *orig);
+
+LDKChannelKeys ChannelKeys_clone(const LDKChannelKeys *orig);
+
/**
* Calls the free function if one is set
*/
void InMemoryChannelKeys_free(LDKInMemoryChannelKeys this_ptr);
+LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const LDKInMemoryChannelKeys *orig);
+
/**
* Private key of anchor tx
*/
void ChannelDetails_free(LDKChannelDetails this_ptr);
+LDKChannelDetails ChannelDetails_clone(const LDKChannelDetails *orig);
+
/**
* The channel's ID (prior to funding transaction generation, this is a random 32 bytes,
* thereafter this is the txid of the funding transaction xor the funding transaction output).
void Init_free(LDKInit this_ptr);
+LDKInit Init_clone(const LDKInit *orig);
+
void ErrorMessage_free(LDKErrorMessage this_ptr);
+LDKErrorMessage ErrorMessage_clone(const LDKErrorMessage *orig);
+
/**
* The channel ID involved in the error
*/
void Ping_free(LDKPing this_ptr);
+LDKPing Ping_clone(const LDKPing *orig);
+
/**
* The desired response length
*/
void Pong_free(LDKPong this_ptr);
+LDKPong Pong_clone(const LDKPong *orig);
+
/**
* The pong packet size.
* This field is not sent on the wire. byteslen zeros are sent.
void OpenChannel_free(LDKOpenChannel this_ptr);
+LDKOpenChannel OpenChannel_clone(const LDKOpenChannel *orig);
+
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void AcceptChannel_free(LDKAcceptChannel this_ptr);
+LDKAcceptChannel AcceptChannel_clone(const LDKAcceptChannel *orig);
+
/**
* A temporary channel ID, until the funding outpoint is announced
*/
void FundingCreated_free(LDKFundingCreated this_ptr);
+LDKFundingCreated FundingCreated_clone(const LDKFundingCreated *orig);
+
/**
* A temporary channel ID, until the funding is established
*/
void FundingSigned_free(LDKFundingSigned this_ptr);
+LDKFundingSigned FundingSigned_clone(const LDKFundingSigned *orig);
+
/**
* The channel ID
*/
void FundingLocked_free(LDKFundingLocked this_ptr);
+LDKFundingLocked FundingLocked_clone(const LDKFundingLocked *orig);
+
/**
* The channel ID
*/
void Shutdown_free(LDKShutdown this_ptr);
+LDKShutdown Shutdown_clone(const LDKShutdown *orig);
+
/**
* The channel ID
*/
void ClosingSigned_free(LDKClosingSigned this_ptr);
+LDKClosingSigned ClosingSigned_clone(const LDKClosingSigned *orig);
+
/**
* The channel ID
*/
void UpdateAddHTLC_free(LDKUpdateAddHTLC this_ptr);
+LDKUpdateAddHTLC UpdateAddHTLC_clone(const LDKUpdateAddHTLC *orig);
+
/**
* The channel ID
*/
void UpdateFulfillHTLC_free(LDKUpdateFulfillHTLC this_ptr);
+LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const LDKUpdateFulfillHTLC *orig);
+
/**
* The channel ID
*/
void UpdateFailHTLC_free(LDKUpdateFailHTLC this_ptr);
+LDKUpdateFailHTLC UpdateFailHTLC_clone(const LDKUpdateFailHTLC *orig);
+
/**
* The channel ID
*/
void UpdateFailMalformedHTLC_free(LDKUpdateFailMalformedHTLC this_ptr);
+LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const LDKUpdateFailMalformedHTLC *orig);
+
/**
* The channel ID
*/
void CommitmentSigned_free(LDKCommitmentSigned this_ptr);
+LDKCommitmentSigned CommitmentSigned_clone(const LDKCommitmentSigned *orig);
+
/**
* The channel ID
*/
void RevokeAndACK_free(LDKRevokeAndACK this_ptr);
+LDKRevokeAndACK RevokeAndACK_clone(const LDKRevokeAndACK *orig);
+
/**
* The channel ID
*/
void UpdateFee_free(LDKUpdateFee this_ptr);
+LDKUpdateFee UpdateFee_clone(const LDKUpdateFee *orig);
+
/**
* The channel ID
*/
void DataLossProtect_free(LDKDataLossProtect this_ptr);
+LDKDataLossProtect DataLossProtect_clone(const LDKDataLossProtect *orig);
+
/**
* Proof that the sender knows the per-commitment secret of a specific commitment transaction
* belonging to the recipient
void ChannelReestablish_free(LDKChannelReestablish this_ptr);
+LDKChannelReestablish ChannelReestablish_clone(const LDKChannelReestablish *orig);
+
/**
* The channel ID
*/
void AnnouncementSignatures_free(LDKAnnouncementSignatures this_ptr);
+LDKAnnouncementSignatures AnnouncementSignatures_clone(const LDKAnnouncementSignatures *orig);
+
/**
* The channel ID
*/
void NetAddress_free(LDKNetAddress this_ptr);
+LDKNetAddress NetAddress_clone(const LDKNetAddress *orig);
+
void UnsignedNodeAnnouncement_free(LDKUnsignedNodeAnnouncement this_ptr);
+LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const LDKUnsignedNodeAnnouncement *orig);
+
/**
* The advertised features
*/
void NodeAnnouncement_free(LDKNodeAnnouncement this_ptr);
+LDKNodeAnnouncement NodeAnnouncement_clone(const LDKNodeAnnouncement *orig);
+
/**
* The signature by the node key
*/
void UnsignedChannelAnnouncement_free(LDKUnsignedChannelAnnouncement this_ptr);
+LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const LDKUnsignedChannelAnnouncement *orig);
+
/**
* The advertised channel features
*/
void ChannelAnnouncement_free(LDKChannelAnnouncement this_ptr);
+LDKChannelAnnouncement ChannelAnnouncement_clone(const LDKChannelAnnouncement *orig);
+
/**
* Authentication of the announcement by the first public node
*/
void UnsignedChannelUpdate_free(LDKUnsignedChannelUpdate this_ptr);
+LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const LDKUnsignedChannelUpdate *orig);
+
/**
* The genesis hash of the blockchain where the channel is to be opened
*/
void ChannelUpdate_free(LDKChannelUpdate this_ptr);
+LDKChannelUpdate ChannelUpdate_clone(const LDKChannelUpdate *orig);
+
/**
* A signature of the channel update
*/
void QueryChannelRange_free(LDKQueryChannelRange this_ptr);
+LDKQueryChannelRange QueryChannelRange_clone(const LDKQueryChannelRange *orig);
+
/**
* The genesis hash of the blockchain being queried
*/
void ReplyChannelRange_free(LDKReplyChannelRange this_ptr);
+LDKReplyChannelRange ReplyChannelRange_clone(const LDKReplyChannelRange *orig);
+
/**
* The genesis hash of the blockchain being queried
*/
void QueryShortChannelIds_free(LDKQueryShortChannelIds this_ptr);
+LDKQueryShortChannelIds QueryShortChannelIds_clone(const LDKQueryShortChannelIds *orig);
+
/**
* The genesis hash of the blockchain being queried
*/
void ReplyShortChannelIdsEnd_free(LDKReplyShortChannelIdsEnd this_ptr);
+LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const LDKReplyShortChannelIdsEnd *orig);
+
/**
* The genesis hash of the blockchain that was queried
*/
void GossipTimestampFilter_free(LDKGossipTimestampFilter this_ptr);
+LDKGossipTimestampFilter GossipTimestampFilter_clone(const LDKGossipTimestampFilter *orig);
+
/**
* The genesis hash of the blockchain for channel and node information
*/
void ErrorAction_free(LDKErrorAction this_ptr);
+LDKErrorAction ErrorAction_clone(const LDKErrorAction *orig);
+
void LightningError_free(LDKLightningError this_ptr);
/**
void CommitmentUpdate_free(LDKCommitmentUpdate this_ptr);
+LDKCommitmentUpdate CommitmentUpdate_clone(const LDKCommitmentUpdate *orig);
+
/**
* update_add_htlc messages which should be sent
*/
void HTLCFailChannelUpdate_free(LDKHTLCFailChannelUpdate this_ptr);
+LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const LDKHTLCFailChannelUpdate *orig);
+
/**
* Calls the free function if one is set
*/
MUST_USE_RES LDKMessageHandler MessageHandler_new(LDKChannelMessageHandler chan_handler_arg, LDKRoutingMessageHandler route_handler_arg);
+LDKSocketDescriptor SocketDescriptor_clone(const LDKSocketDescriptor *orig);
+
/**
* Calls the free function if one is set
*/
void TxCreationKeys_free(LDKTxCreationKeys this_ptr);
+LDKTxCreationKeys TxCreationKeys_clone(const LDKTxCreationKeys *orig);
+
/**
* The broadcaster's per-commitment public key which was used to derive the other keys.
*/
void PreCalculatedTxCreationKeys_free(LDKPreCalculatedTxCreationKeys this_ptr);
+LDKPreCalculatedTxCreationKeys PreCalculatedTxCreationKeys_clone(const LDKPreCalculatedTxCreationKeys *orig);
+
/**
* Create a new PreCalculatedTxCreationKeys from TxCreationKeys
*/
void ChannelPublicKeys_free(LDKChannelPublicKeys this_ptr);
+LDKChannelPublicKeys ChannelPublicKeys_clone(const LDKChannelPublicKeys *orig);
+
/**
* The public key which is used to sign all commitment transactions, as it appears in the
* on-chain channel lock-in 2-of-2 multisig output.
void HTLCOutputInCommitment_free(LDKHTLCOutputInCommitment this_ptr);
+LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const LDKHTLCOutputInCommitment *orig);
+
/**
* Whether the HTLC was \"offered\" (ie outbound in relation to this commitment transaction).
* Note that this is not the same as whether it is ountbound *from us*. To determine that you
void HolderCommitmentTransaction_free(LDKHolderCommitmentTransaction this_ptr);
+LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const LDKHolderCommitmentTransaction *orig);
+
/**
* The commitment transaction itself, in unsigned form.
*/
void RouteHop_free(LDKRouteHop this_ptr);
+LDKRouteHop RouteHop_clone(const LDKRouteHop *orig);
+
/**
* The node_id of the node at this hop.
*/
void Route_free(LDKRoute this_ptr);
+LDKRoute Route_clone(const LDKRoute *orig);
+
/**
* The list of routes taken for a single (potentially-)multi-part payment. The pubkey of the
* last RouteHop in each path must be the same.
void RouteHint_free(LDKRouteHint this_ptr);
+LDKRouteHint RouteHint_clone(const LDKRouteHint *orig);
+
/**
* The node_id of the non-target end of the route
*/
void RoutingFees_free(LDKRoutingFees this_ptr);
+LDKRoutingFees RoutingFees_clone(const LDKRoutingFees *orig);
+
/**
* Flat routing fee in satoshis
*/
*/
MUST_USE_RES LDKNetworkGraph NetworkGraph_new(void);
+/**
+ * For an already known node (from channel announcements), update its stored properties from a
+ * given node announcement.
+ *
+ * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
+ * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
+ * routing messages from a source using a protocol other than the lightning P2P protocol.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(LDKNetworkGraph *this_arg, const LDKNodeAnnouncement *msg);
+
+/**
+ * For an already known node (from channel announcements), update its stored properties from a
+ * given node announcement without verifying the associated signatures. Because we aren't
+ * given the associated signatures here we cannot relay the node announcement to any of our
+ * peers.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(LDKNetworkGraph *this_arg, const LDKUnsignedNodeAnnouncement *msg);
+
+/**
+ * Store or update channel info from a channel announcement.
+ *
+ * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
+ * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
+ * routing messages from a source using a protocol other than the lightning P2P protocol.
+ *
+ * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
+ * the corresponding UTXO exists on chain and is correctly-formatted.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(LDKNetworkGraph *this_arg, const LDKChannelAnnouncement *msg, LDKAccess *chain_access);
+
+/**
+ * Store or update channel info from a channel announcement without verifying the associated
+ * signatures. Because we aren't given the associated signatures here we cannot relay the
+ * channel announcement to any of our peers.
+ *
+ * If a `chain::Access` object is provided via `chain_access`, it will be called to verify
+ * the corresponding UTXO exists on chain and is correctly-formatted.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(LDKNetworkGraph *this_arg, const LDKUnsignedChannelAnnouncement *msg, LDKAccess *chain_access);
+
/**
* Close a channel if a corresponding HTLC fail was sent.
* If permanent, removes a channel from the local storage.
*/
void NetworkGraph_close_channel_from_update(LDKNetworkGraph *this_arg, uint64_t short_channel_id, bool is_permanent);
+/**
+ * For an already known (from announcement) channel, update info about one of the directions
+ * of the channel.
+ *
+ * You probably don't want to call this directly, instead relying on a NetGraphMsgHandler's
+ * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept
+ * routing messages from a source using a protocol other than the lightning P2P protocol.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(LDKNetworkGraph *this_arg, const LDKChannelUpdate *msg);
+
+/**
+ * For an already known (from announcement) channel, update info about one of the directions
+ * of the channel without verifying the associated signatures. Because we aren't given the
+ * associated signatures here we cannot relay the channel update to any of our peers.
+ */
+MUST_USE_RES LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(LDKNetworkGraph *this_arg, const LDKUnsignedChannelUpdate *msg);
+
/* Text to put at the end of the generated file */