* `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;
* 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 {
/**
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 {
+typedef struct LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_C2TupleTempl_u32__TxOut {
LDKThirtyTwoBytes a;
- LDKCVecTempl_TxOut b;
-} LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut;
+ 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;
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 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];
* 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);
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 (*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);
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
*/
const LDKChannelMonitor* operator &() const { return &self; }
const LDKChannelMonitor* operator ->() const { return &self; }
};
+class Persist {
+private:
+ LDKPersist self;
+public:
+ Persist(const Persist&) = delete;
+ ~Persist() { Persist_free(self); }
+ 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; }
+ LDKPersist* operator &() { return &self; }
+ LDKPersist* operator ->() { return &self; }
+ const LDKPersist* operator &() const { return &self; }
+ const LDKPersist* operator ->() const { return &self; }
+};
class OutPoint {
private:
LDKOutPoint self;
const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() const { return &self; }
const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() const { return &self; }
};
+class C2Tuple_u32TxOutZ {
+private:
+ LDKC2Tuple_u32TxOutZ self;
+public:
+ C2Tuple_u32TxOutZ(const C2Tuple_u32TxOutZ&) = delete;
+ ~C2Tuple_u32TxOutZ() { C2Tuple_u32TxOutZ_free(self); }
+ C2Tuple_u32TxOutZ(C2Tuple_u32TxOutZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_u32TxOutZ)); }
+ C2Tuple_u32TxOutZ(LDKC2Tuple_u32TxOutZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_u32TxOutZ)); }
+ operator LDKC2Tuple_u32TxOutZ() { LDKC2Tuple_u32TxOutZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_u32TxOutZ)); return res; }
+ LDKC2Tuple_u32TxOutZ* operator &() { return &self; }
+ LDKC2Tuple_u32TxOutZ* operator ->() { return &self; }
+ const LDKC2Tuple_u32TxOutZ* operator &() const { return &self; }
+ const LDKC2Tuple_u32TxOutZ* operator ->() const { return &self; }
+};
class CResult_NoneMonitorUpdateErrorZ {
private:
LDKCResult_NoneMonitorUpdateErrorZ self;
const LDKCResult_NoneMonitorUpdateErrorZ* operator &() const { return &self; }
const LDKCResult_NoneMonitorUpdateErrorZ* operator ->() const { return &self; }
};
-class CVec_UpdateFailHTLCZ {
-private:
- LDKCVec_UpdateFailHTLCZ self;
-public:
- CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete;
- ~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); }
- CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); }
- CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); }
- operator LDKCVec_UpdateFailHTLCZ() { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; }
- LDKCVec_UpdateFailHTLCZ* operator &() { return &self; }
- LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; }
- const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; }
- const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; }
-};
class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ {
private:
LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ self;
const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() const { return &self; }
const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() const { return &self; }
};
-class CVec_NodeAnnouncementZ {
+class CVec_PublicKeyZ {
private:
- LDKCVec_NodeAnnouncementZ self;
+ LDKCVec_PublicKeyZ self;
public:
- CVec_NodeAnnouncementZ(const CVec_NodeAnnouncementZ&) = delete;
- ~CVec_NodeAnnouncementZ() { CVec_NodeAnnouncementZ_free(self); }
- CVec_NodeAnnouncementZ(CVec_NodeAnnouncementZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_NodeAnnouncementZ)); }
- CVec_NodeAnnouncementZ(LDKCVec_NodeAnnouncementZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_NodeAnnouncementZ)); }
- operator LDKCVec_NodeAnnouncementZ() { LDKCVec_NodeAnnouncementZ res = self; memset(&self, 0, sizeof(LDKCVec_NodeAnnouncementZ)); return res; }
- LDKCVec_NodeAnnouncementZ* operator &() { return &self; }
- LDKCVec_NodeAnnouncementZ* operator ->() { return &self; }
- const LDKCVec_NodeAnnouncementZ* operator &() const { return &self; }
- const LDKCVec_NodeAnnouncementZ* operator ->() const { return &self; }
+ CVec_PublicKeyZ(const CVec_PublicKeyZ&) = delete;
+ ~CVec_PublicKeyZ() { CVec_PublicKeyZ_free(self); }
+ CVec_PublicKeyZ(CVec_PublicKeyZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_PublicKeyZ)); }
+ CVec_PublicKeyZ(LDKCVec_PublicKeyZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_PublicKeyZ)); }
+ operator LDKCVec_PublicKeyZ() { LDKCVec_PublicKeyZ res = self; memset(&self, 0, sizeof(LDKCVec_PublicKeyZ)); return res; }
+ LDKCVec_PublicKeyZ* operator &() { return &self; }
+ LDKCVec_PublicKeyZ* operator ->() { return &self; }
+ const LDKCVec_PublicKeyZ* operator &() const { return &self; }
+ const LDKCVec_PublicKeyZ* operator ->() const { return &self; }
};
class CResult_boolLightningErrorZ {
private:
const LDKCResult_boolLightningErrorZ* operator &() const { return &self; }
const LDKCResult_boolLightningErrorZ* operator ->() const { return &self; }
};
-class CVec_PublicKeyZ {
+class CVec_C2Tuple_u32TxOutZZ {
private:
- LDKCVec_PublicKeyZ self;
+ LDKCVec_C2Tuple_u32TxOutZZ self;
public:
- CVec_PublicKeyZ(const CVec_PublicKeyZ&) = delete;
- ~CVec_PublicKeyZ() { CVec_PublicKeyZ_free(self); }
- CVec_PublicKeyZ(CVec_PublicKeyZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_PublicKeyZ)); }
- CVec_PublicKeyZ(LDKCVec_PublicKeyZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_PublicKeyZ)); }
- operator LDKCVec_PublicKeyZ() { LDKCVec_PublicKeyZ res = self; memset(&self, 0, sizeof(LDKCVec_PublicKeyZ)); return res; }
- LDKCVec_PublicKeyZ* operator &() { return &self; }
- LDKCVec_PublicKeyZ* operator ->() { return &self; }
- const LDKCVec_PublicKeyZ* operator &() const { return &self; }
- const LDKCVec_PublicKeyZ* operator ->() const { return &self; }
-};
-class CResult_SecretKeySecpErrorZ {
-private:
- LDKCResult_SecretKeySecpErrorZ self;
-public:
- CResult_SecretKeySecpErrorZ(const CResult_SecretKeySecpErrorZ&) = delete;
- ~CResult_SecretKeySecpErrorZ() { CResult_SecretKeySecpErrorZ_free(self); }
- CResult_SecretKeySecpErrorZ(CResult_SecretKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); }
- CResult_SecretKeySecpErrorZ(LDKCResult_SecretKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); }
- operator LDKCResult_SecretKeySecpErrorZ() { LDKCResult_SecretKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); return res; }
- LDKCResult_SecretKeySecpErrorZ* operator &() { return &self; }
- LDKCResult_SecretKeySecpErrorZ* operator ->() { return &self; }
- const LDKCResult_SecretKeySecpErrorZ* operator &() const { return &self; }
- const LDKCResult_SecretKeySecpErrorZ* operator ->() const { return &self; }
+ CVec_C2Tuple_u32TxOutZZ(const CVec_C2Tuple_u32TxOutZZ&) = delete;
+ ~CVec_C2Tuple_u32TxOutZZ() { CVec_C2Tuple_u32TxOutZZ_free(self); }
+ 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; }
+ 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 CVec_SignatureZ {
private:
const LDKCVec_UpdateFailMalformedHTLCZ* operator &() const { return &self; }
const LDKCVec_UpdateFailMalformedHTLCZ* operator ->() const { return &self; }
};
+class CResult_SecretKeySecpErrorZ {
+private:
+ LDKCResult_SecretKeySecpErrorZ self;
+public:
+ CResult_SecretKeySecpErrorZ(const CResult_SecretKeySecpErrorZ&) = delete;
+ ~CResult_SecretKeySecpErrorZ() { CResult_SecretKeySecpErrorZ_free(self); }
+ CResult_SecretKeySecpErrorZ(CResult_SecretKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SecretKeySecpErrorZ)); }
+ CResult_SecretKeySecpErrorZ(LDKCResult_SecretKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); }
+ operator LDKCResult_SecretKeySecpErrorZ() { LDKCResult_SecretKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_SecretKeySecpErrorZ)); return res; }
+ LDKCResult_SecretKeySecpErrorZ* operator &() { return &self; }
+ LDKCResult_SecretKeySecpErrorZ* operator ->() { return &self; }
+ const LDKCResult_SecretKeySecpErrorZ* operator &() const { return &self; }
+ const LDKCResult_SecretKeySecpErrorZ* operator ->() const { return &self; }
+};
class C2Tuple_HTLCOutputInCommitmentSignatureZ {
private:
LDKC2Tuple_HTLCOutputInCommitmentSignatureZ self;
const LDKCResult_SignatureNoneZ* operator &() const { return &self; }
const LDKCResult_SignatureNoneZ* operator ->() const { return &self; }
};
-class C2Tuple_TxidCVec_TxOutZZ {
+class C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
private:
- LDKC2Tuple_TxidCVec_TxOutZZ self;
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ self;
public:
- C2Tuple_TxidCVec_TxOutZZ(const C2Tuple_TxidCVec_TxOutZZ&) = delete;
- ~C2Tuple_TxidCVec_TxOutZZ() { C2Tuple_TxidCVec_TxOutZZ_free(self); }
- C2Tuple_TxidCVec_TxOutZZ(C2Tuple_TxidCVec_TxOutZZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_TxidCVec_TxOutZZ)); }
- C2Tuple_TxidCVec_TxOutZZ(LDKC2Tuple_TxidCVec_TxOutZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_TxidCVec_TxOutZZ)); }
- operator LDKC2Tuple_TxidCVec_TxOutZZ() { LDKC2Tuple_TxidCVec_TxOutZZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_TxidCVec_TxOutZZ)); return res; }
- LDKC2Tuple_TxidCVec_TxOutZZ* operator &() { return &self; }
- LDKC2Tuple_TxidCVec_TxOutZZ* operator ->() { return &self; }
- const LDKC2Tuple_TxidCVec_TxOutZZ* operator &() const { return &self; }
- const LDKC2Tuple_TxidCVec_TxOutZZ* operator ->() const { return &self; }
+ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ(const C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ&) = delete;
+ ~C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ() { C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(self); }
+ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ(C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ)); }
+ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ)); }
+ operator LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ() { LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ)); return res; }
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator &() { return &self; }
+ LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator ->() { return &self; }
+ const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator &() const { return &self; }
+ const LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* operator ->() const { return &self; }
};
class CVec_ChannelDetailsZ {
private:
const LDKCVec_MessageSendEventZ* operator &() const { return &self; }
const LDKCVec_MessageSendEventZ* operator ->() const { return &self; }
};
+class CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
+private:
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ self;
+public:
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ(const CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ&) = delete;
+ ~CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ() { CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(self); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ(CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ)); }
+ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ)); }
+ operator LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ() { LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ)); return res; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator &() { return &self; }
+ LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator ->() { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator &() const { return &self; }
+ const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ* operator ->() const { return &self; }
+};
class CResult_NoneAPIErrorZ {
private:
LDKCResult_NoneAPIErrorZ self;
const LDKCVec_NetAddressZ* operator &() const { return &self; }
const LDKCVec_NetAddressZ* operator ->() const { return &self; }
};
-class CVec_TxOutZ {
-private:
- LDKCVec_TxOutZ self;
-public:
- CVec_TxOutZ(const CVec_TxOutZ&) = delete;
- ~CVec_TxOutZ() { CVec_TxOutZ_free(self); }
- CVec_TxOutZ(CVec_TxOutZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_TxOutZ)); }
- CVec_TxOutZ(LDKCVec_TxOutZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_TxOutZ)); }
- operator LDKCVec_TxOutZ() { LDKCVec_TxOutZ res = self; memset(&self, 0, sizeof(LDKCVec_TxOutZ)); return res; }
- LDKCVec_TxOutZ* operator &() { return &self; }
- LDKCVec_TxOutZ* operator ->() { return &self; }
- const LDKCVec_TxOutZ* operator &() const { return &self; }
- const LDKCVec_TxOutZ* operator ->() const { return &self; }
-};
class C2Tuple_usizeTransactionZ {
private:
LDKC2Tuple_usizeTransactionZ self;
const LDKCVec_C2Tuple_usizeTransactionZZ* operator &() const { return &self; }
const LDKCVec_C2Tuple_usizeTransactionZZ* operator ->() const { return &self; }
};
+class CVec_TransactionZ {
+private:
+ LDKCVec_TransactionZ self;
+public:
+ CVec_TransactionZ(const CVec_TransactionZ&) = delete;
+ ~CVec_TransactionZ() { CVec_TransactionZ_free(self); }
+ CVec_TransactionZ(CVec_TransactionZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_TransactionZ)); }
+ CVec_TransactionZ(LDKCVec_TransactionZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_TransactionZ)); }
+ operator LDKCVec_TransactionZ() { LDKCVec_TransactionZ res = self; memset(&self, 0, sizeof(LDKCVec_TransactionZ)); return res; }
+ LDKCVec_TransactionZ* operator &() { return &self; }
+ LDKCVec_TransactionZ* operator ->() { return &self; }
+ const LDKCVec_TransactionZ* operator &() const { return &self; }
+ const LDKCVec_TransactionZ* operator ->() const { return &self; }
+};
class CVec_ChannelMonitorZ {
private:
LDKCVec_ChannelMonitorZ self;
const LDKCVec_ChannelMonitorZ* operator &() const { return &self; }
const LDKCVec_ChannelMonitorZ* operator ->() const { return &self; }
};
-class CVec_TransactionZ {
+class CVec_UpdateFailHTLCZ {
private:
- LDKCVec_TransactionZ self;
+ LDKCVec_UpdateFailHTLCZ self;
public:
- CVec_TransactionZ(const CVec_TransactionZ&) = delete;
- ~CVec_TransactionZ() { CVec_TransactionZ_free(self); }
- CVec_TransactionZ(CVec_TransactionZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_TransactionZ)); }
- CVec_TransactionZ(LDKCVec_TransactionZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_TransactionZ)); }
- operator LDKCVec_TransactionZ() { LDKCVec_TransactionZ res = self; memset(&self, 0, sizeof(LDKCVec_TransactionZ)); return res; }
- LDKCVec_TransactionZ* operator &() { return &self; }
- LDKCVec_TransactionZ* operator ->() { return &self; }
- const LDKCVec_TransactionZ* operator &() const { return &self; }
- const LDKCVec_TransactionZ* operator ->() const { return &self; }
+ CVec_UpdateFailHTLCZ(const CVec_UpdateFailHTLCZ&) = delete;
+ ~CVec_UpdateFailHTLCZ() { CVec_UpdateFailHTLCZ_free(self); }
+ CVec_UpdateFailHTLCZ(CVec_UpdateFailHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailHTLCZ)); }
+ CVec_UpdateFailHTLCZ(LDKCVec_UpdateFailHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); }
+ operator LDKCVec_UpdateFailHTLCZ() { LDKCVec_UpdateFailHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailHTLCZ)); return res; }
+ LDKCVec_UpdateFailHTLCZ* operator &() { return &self; }
+ LDKCVec_UpdateFailHTLCZ* operator ->() { return &self; }
+ const LDKCVec_UpdateFailHTLCZ* operator &() const { return &self; }
+ const LDKCVec_UpdateFailHTLCZ* operator ->() const { return &self; }
};
-class CVec_C2Tuple_TxidCVec_TxOutZZZ {
+class CVec_NodeAnnouncementZ {
private:
- LDKCVec_C2Tuple_TxidCVec_TxOutZZZ self;
+ LDKCVec_NodeAnnouncementZ self;
public:
- CVec_C2Tuple_TxidCVec_TxOutZZZ(const CVec_C2Tuple_TxidCVec_TxOutZZZ&) = delete;
- ~CVec_C2Tuple_TxidCVec_TxOutZZZ() { CVec_C2Tuple_TxidCVec_TxOutZZZ_free(self); }
- CVec_C2Tuple_TxidCVec_TxOutZZZ(CVec_C2Tuple_TxidCVec_TxOutZZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_TxidCVec_TxOutZZZ)); }
- CVec_C2Tuple_TxidCVec_TxOutZZZ(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ)); }
- operator LDKCVec_C2Tuple_TxidCVec_TxOutZZZ() { LDKCVec_C2Tuple_TxidCVec_TxOutZZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ)); return res; }
- LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* operator &() { return &self; }
- LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* operator ->() { return &self; }
- const LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* operator &() const { return &self; }
- const LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* operator ->() const { return &self; }
+ CVec_NodeAnnouncementZ(const CVec_NodeAnnouncementZ&) = delete;
+ ~CVec_NodeAnnouncementZ() { CVec_NodeAnnouncementZ_free(self); }
+ CVec_NodeAnnouncementZ(CVec_NodeAnnouncementZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_NodeAnnouncementZ)); }
+ CVec_NodeAnnouncementZ(LDKCVec_NodeAnnouncementZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_NodeAnnouncementZ)); }
+ operator LDKCVec_NodeAnnouncementZ() { LDKCVec_NodeAnnouncementZ res = self; memset(&self, 0, sizeof(LDKCVec_NodeAnnouncementZ)); return res; }
+ LDKCVec_NodeAnnouncementZ* operator &() { return &self; }
+ LDKCVec_NodeAnnouncementZ* operator ->() { return &self; }
+ const LDKCVec_NodeAnnouncementZ* operator &() const { return &self; }
+ const LDKCVec_NodeAnnouncementZ* operator ->() const { return &self; }
};
class C2Tuple_u64u64Z {
private:
typedef struct nativeCommitmentUpdateOpaque LDKnativeCommitmentUpdate;
struct nativeMessageHandlerOpaque;
typedef struct nativeMessageHandlerOpaque LDKnativeMessageHandler;
+typedef struct LDKSocketDescriptor LDKSocketDescriptor;
struct nativePeerHandleErrorOpaque;
typedef struct nativePeerHandleErrorOpaque LDKnativePeerHandleError;
struct nativePeerManagerOpaque;
pub static CVec_TransactionZ_free: extern "C" fn(CVec_TransactionZ) = crate::c_types::CVecTempl_free::<crate::c_types::Transaction>;
#[no_mangle]
-pub type CVec_TxOutZ = crate::c_types::CVecTempl<crate::c_types::TxOut>;
+pub type C2Tuple_u32TxOutZ = crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>;
#[no_mangle]
-pub static CVec_TxOutZ_free: extern "C" fn(CVec_TxOutZ) = crate::c_types::CVecTempl_free::<crate::c_types::TxOut>;
+pub static C2Tuple_u32TxOutZ_free: extern "C" fn(C2Tuple_u32TxOutZ) = crate::c_types::C2TupleTempl_free::<u32, crate::c_types::TxOut>;
+#[no_mangle]
+pub extern "C" fn C2Tuple_u32TxOutZ_new(a: u32, b: crate::c_types::TxOut) -> C2Tuple_u32TxOutZ {
+ C2Tuple_u32TxOutZ { a, b, }
+}
+
+#[no_mangle]
+pub type CVec_C2Tuple_u32TxOutZZ = crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>;
+#[no_mangle]
+pub static CVec_C2Tuple_u32TxOutZZ_free: extern "C" fn(CVec_C2Tuple_u32TxOutZZ) = crate::c_types::CVecTempl_free::<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>;
#[no_mangle]
-pub type C2Tuple_TxidCVec_TxOutZZ = crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>;
+pub type C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ = crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>>;
#[no_mangle]
-pub static C2Tuple_TxidCVec_TxOutZZ_free: extern "C" fn(C2Tuple_TxidCVec_TxOutZZ) = crate::c_types::C2TupleTempl_free::<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>;
+pub static C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free: extern "C" fn(C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) = crate::c_types::C2TupleTempl_free::<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>>;
#[no_mangle]
-pub extern "C" fn C2Tuple_TxidCVec_TxOutZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_TxOutZ) -> C2Tuple_TxidCVec_TxOutZZ {
- C2Tuple_TxidCVec_TxOutZZ { a, b, }
+pub extern "C" fn C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a: crate::c_types::ThirtyTwoBytes, b: crate::c_types::derived::CVec_C2Tuple_u32TxOutZZ) -> C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ {
+ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ { a, b, }
}
#[no_mangle]
-pub type CVec_C2Tuple_TxidCVec_TxOutZZZ = crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>>;
+pub type CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ = crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>>>;
#[no_mangle]
-pub static CVec_C2Tuple_TxidCVec_TxOutZZZ_free: extern "C" fn(CVec_C2Tuple_TxidCVec_TxOutZZZ) = crate::c_types::CVecTempl_free::<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::TxOut>>>;
+pub static CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free: extern "C" fn(CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ) = crate::c_types::CVecTempl_free::<crate::c_types::C2TupleTempl<crate::c_types::ThirtyTwoBytes, crate::c_types::CVecTempl<crate::c_types::C2TupleTempl<u32, crate::c_types::TxOut>>>>;
#[no_mangle]
pub type C2Tuple_u64u64Z = crate::c_types::C2TupleTempl<u64, u64>;
}
}
}
+#[no_mangle]
+pub extern "C" fn ConfirmationTarget_clone(orig: &ConfirmationTarget) -> ConfirmationTarget {
+ orig.clone()
+}
/// A trait which should be implemented to provide feerate information on a number of time
/// horizons.
///
use lightning::chain::chainmonitor::ChainMonitor as nativeChainMonitorImport;
-type nativeChainMonitor = nativeChainMonitorImport<crate::chain::keysinterface::ChannelKeys, crate::chain::Filter, crate::chain::chaininterface::BroadcasterInterface, crate::chain::chaininterface::FeeEstimator, crate::util::logger::Logger>;
+type nativeChainMonitor = nativeChainMonitorImport<crate::chain::keysinterface::ChannelKeys, crate::chain::Filter, crate::chain::chaininterface::BroadcasterInterface, crate::chain::chaininterface::FeeEstimator, crate::util::logger::Logger, crate::chain::channelmonitor::Persist>;
/// An implementation of [`chain::Watch`] for monitoring channels.
///
/// [`chain::Filter`]: ../trait.Filter.html
#[must_use]
#[no_mangle]
-pub extern "C" fn ChainMonitor_new(chain_source: *mut crate::chain::Filter, mut broadcaster: crate::chain::chaininterface::BroadcasterInterface, mut logger: crate::util::logger::Logger, mut feeest: crate::chain::chaininterface::FeeEstimator) -> ChainMonitor {
+pub extern "C" fn ChainMonitor_new(chain_source: *mut crate::chain::Filter, mut broadcaster: crate::chain::chaininterface::BroadcasterInterface, mut logger: crate::util::logger::Logger, mut feeest: crate::chain::chaininterface::FeeEstimator, mut persister: crate::chain::channelmonitor::Persist) -> ChainMonitor {
let mut local_chain_source = if chain_source == std::ptr::null_mut() { None } else { Some( { unsafe { *Box::from_raw(chain_source) } }) };
- let mut ret = lightning::chain::chainmonitor::ChainMonitor::new(local_chain_source, broadcaster, logger, feeest);
+ let mut ret = lightning::chain::chainmonitor::ChainMonitor::new(local_chain_source, broadcaster, logger, feeest, persister);
ChainMonitor { inner: Box::into_raw(Box::new(ret)), is_owned: true }
}
}
use lightning::chain::Watch as WatchTraitImport;
#[must_use]
-extern "C" fn ChainMonitor_Watch_watch_channel(this_arg: *const c_void, mut funding_txo: crate::chain::transaction::OutPoint, mut monitor: crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ {
- let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.watch_channel(*unsafe { Box::from_raw(funding_txo.take_ptr()) }, *unsafe { Box::from_raw(monitor.take_ptr()) });
+extern "C" fn ChainMonitor_Watch_watch_channel(this_arg: *const c_void, mut funding_outpoint: crate::chain::transaction::OutPoint, mut monitor: crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ {
+ let mut ret = unsafe { &mut *(this_arg as *mut nativeChainMonitor) }.watch_channel(*unsafe { Box::from_raw(funding_outpoint.take_ptr()) }, *unsafe { Box::from_raw(monitor.take_ptr()) });
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { 0u8 /*o*/ }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::chain::channelmonitor::ChannelMonitorUpdateErr::native_into(e) }) };
local_ret
}
pub(crate) extern "C" fn ChannelMonitorUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelMonitorUpdate)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelMonitorUpdate_clone(orig: &ChannelMonitorUpdate) -> ChannelMonitorUpdate {
+ ChannelMonitorUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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
#[no_mangle]
pub extern "C" fn ChannelMonitorUpdate_get_update_id(this_ptr: &ChannelMonitorUpdate) -> u64 {
let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.update_id;
}
/// 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
#[no_mangle]
pub extern "C" fn ChannelMonitorUpdate_set_update_id(this_ptr: &mut ChannelMonitorUpdate, mut val: u64) {
unsafe { &mut *this_ptr.inner }.update_id = val;
}
+
+#[no_mangle]
+pub static CLOSED_CHANNEL_UPDATE_ID: u64 = lightning::chain::channelmonitor::CLOSED_CHANNEL_UPDATE_ID;
#[no_mangle]
pub extern "C" fn ChannelMonitorUpdate_write(obj: *const ChannelMonitorUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
}
}
}
+#[no_mangle]
+pub extern "C" fn ChannelMonitorUpdateErr_clone(orig: &ChannelMonitorUpdateErr) -> ChannelMonitorUpdateErr {
+ orig.clone()
+}
use lightning::chain::channelmonitor::MonitorUpdateError as nativeMonitorUpdateErrorImport;
type nativeMonitorUpdateError = nativeMonitorUpdateErrorImport;
/// 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.
#[must_use]
#[repr(C)]
pub struct MonitorUpdateError {
ret
}
}
+impl Clone for MonitorEvent {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn MonitorEvent_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeMonitorEvent)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn MonitorEvent_clone(orig: &MonitorEvent) -> MonitorEvent {
+ MonitorEvent { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
use lightning::chain::channelmonitor::HTLCUpdate as nativeHTLCUpdateImport;
type nativeHTLCUpdate = nativeHTLCUpdateImport;
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCUpdate)).clone() })) as *mut c_void
}
#[no_mangle]
+pub extern "C" fn HTLCUpdate_clone(orig: &HTLCUpdate) -> HTLCUpdate {
+ HTLCUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
+#[no_mangle]
pub extern "C" fn HTLCUpdate_write(obj: *const HTLCUpdate) -> crate::c_types::derived::CVec_u8Z {
crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) })
}
/// panics if the given update is not the next update by update_id.
#[must_use]
#[no_mangle]
-pub extern "C" fn ChannelMonitor_update_monitor(this_arg: &mut ChannelMonitor, mut updates: crate::chain::channelmonitor::ChannelMonitorUpdate, broadcaster: &crate::chain::chaininterface::BroadcasterInterface, logger: &crate::util::logger::Logger) -> crate::c_types::derived::CResult_NoneMonitorUpdateErrorZ {
- let mut ret = unsafe { &mut (*(this_arg.inner as *mut nativeChannelMonitor)) }.update_monitor(*unsafe { Box::from_raw(updates.take_ptr()) }, broadcaster, logger);
+pub extern "C" fn ChannelMonitor_update_monitor(this_arg: &mut ChannelMonitor, updates: &crate::chain::channelmonitor::ChannelMonitorUpdate, broadcaster: &crate::chain::chaininterface::BroadcasterInterface, fee_estimator: &crate::chain::chaininterface::FeeEstimator, logger: &crate::util::logger::Logger) -> crate::c_types::derived::CResult_NoneMonitorUpdateErrorZ {
+ let mut ret = unsafe { &mut (*(this_arg.inner as *mut nativeChannelMonitor)) }.update_monitor(unsafe { &*updates.inner }, broadcaster, fee_estimator, logger);
let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { 0u8 /*o*/ }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::chain::channelmonitor::MonitorUpdateError { inner: Box::into_raw(Box::new(e)), is_owned: true } }) };
local_ret
}
/// [`get_outputs_to_watch`]: #method.get_outputs_to_watch
#[must_use]
#[no_mangle]
-pub extern "C" fn ChannelMonitor_block_connected(this_arg: &mut ChannelMonitor, header: *const [u8; 80], mut txdata: crate::c_types::derived::CVec_C2Tuple_usizeTransactionZZ, mut height: u32, mut broadcaster: crate::chain::chaininterface::BroadcasterInterface, mut fee_estimator: crate::chain::chaininterface::FeeEstimator, mut logger: crate::util::logger::Logger) -> crate::c_types::derived::CVec_C2Tuple_TxidCVec_TxOutZZZ {
+pub extern "C" fn ChannelMonitor_block_connected(this_arg: &mut ChannelMonitor, header: *const [u8; 80], mut txdata: crate::c_types::derived::CVec_C2Tuple_usizeTransactionZZ, mut height: u32, mut broadcaster: crate::chain::chaininterface::BroadcasterInterface, mut fee_estimator: crate::chain::chaininterface::FeeEstimator, mut logger: crate::util::logger::Logger) -> crate::c_types::derived::CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ {
let mut local_txdata = Vec::new(); for mut item in txdata.into_rust().drain(..) { local_txdata.push( { let (mut orig_txdata_0_0, mut orig_txdata_0_1) = item.to_rust(); let mut local_txdata_0 = (orig_txdata_0_0, orig_txdata_0_1.into_bitcoin()); local_txdata_0 }); };
let mut ret = unsafe { &mut (*(this_arg.inner as *mut nativeChannelMonitor)) }.block_connected(&::bitcoin::consensus::encode::deserialize(unsafe { &*header }).unwrap(), &local_txdata.iter().map(|(a, b)| (*a, b)).collect::<Vec<_>>()[..], height, broadcaster, fee_estimator, logger);
- let mut local_ret = Vec::new(); for item in ret.drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1) = item; let mut local_orig_ret_0_1 = Vec::new(); for item in orig_ret_0_1.drain(..) { local_orig_ret_0_1.push( { crate::c_types::TxOut::from_rust(item) }); }; let mut local_ret_0 = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0_0.into_inner() }, local_orig_ret_0_1.into()).into(); local_ret_0 }); };
+ let mut local_ret = Vec::new(); for item in ret.drain(..) { local_ret.push( { let (mut orig_ret_0_0, mut orig_ret_0_1) = item; let mut local_orig_ret_0_1 = Vec::new(); for item in orig_ret_0_1.drain(..) { local_orig_ret_0_1.push( { let (mut orig_orig_ret_0_1_0_0, mut orig_orig_ret_0_1_0_1) = item; let mut local_orig_ret_0_1_0 = (orig_orig_ret_0_1_0_0, crate::c_types::TxOut::from_rust(orig_orig_ret_0_1_0_1)).into(); local_orig_ret_0_1_0 }); }; let mut local_ret_0 = (crate::c_types::ThirtyTwoBytes { data: orig_ret_0_0.into_inner() }, local_orig_ret_0_1.into()).into(); local_ret_0 }); };
local_ret.into()
}
unsafe { &mut (*(this_arg.inner as *mut nativeChannelMonitor)) }.block_disconnected(&::bitcoin::consensus::encode::deserialize(unsafe { &*header }).unwrap(), height, broadcaster, fee_estimator, logger)
}
+/// `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.
+#[repr(C)]
+pub struct Persist {
+ pub this_arg: *mut c_void,
+ /// 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
+ #[must_use]
+ pub persist_new_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
+ /// 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
+ #[must_use]
+ pub update_persisted_channel: extern "C" fn (this_arg: *const c_void, id: crate::chain::transaction::OutPoint, update: &crate::chain::channelmonitor::ChannelMonitorUpdate, data: &crate::chain::channelmonitor::ChannelMonitor) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ,
+ pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
+}
+unsafe impl Send for Persist {}
+unsafe impl Sync for Persist {}
+
+use lightning::chain::channelmonitor::Persist as rustPersist;
+impl rustPersist<crate::chain::keysinterface::ChannelKeys> for Persist {
+ fn persist_new_channel(&self, id: lightning::chain::transaction::OutPoint, data: &lightning::chain::channelmonitor::ChannelMonitor<crate::chain::keysinterface::ChannelKeys>) -> Result<(), lightning::chain::channelmonitor::ChannelMonitorUpdateErr> {
+ let mut ret = (self.persist_new_channel)(self.this_arg, crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(id)), is_owned: true }, &crate::chain::channelmonitor::ChannelMonitor { inner: unsafe { (data as *const _) as *mut _ }, is_owned: false });
+ let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(ret.contents.result.take_ptr()) })*/ }), false => Err( { (*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).into_native() })};
+ local_ret
+ }
+ fn update_persisted_channel(&self, id: lightning::chain::transaction::OutPoint, update: &lightning::chain::channelmonitor::ChannelMonitorUpdate, data: &lightning::chain::channelmonitor::ChannelMonitor<crate::chain::keysinterface::ChannelKeys>) -> Result<(), lightning::chain::channelmonitor::ChannelMonitorUpdateErr> {
+ let mut ret = (self.update_persisted_channel)(self.this_arg, crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(id)), is_owned: true }, &crate::chain::channelmonitor::ChannelMonitorUpdate { inner: unsafe { (update as *const _) as *mut _ }, is_owned: false }, &crate::chain::channelmonitor::ChannelMonitor { inner: unsafe { (data as *const _) as *mut _ }, is_owned: false });
+ let mut local_ret = match ret.result_ok { true => Ok( { () /*(*unsafe { Box::from_raw(ret.contents.result.take_ptr()) })*/ }), false => Err( { (*unsafe { Box::from_raw(ret.contents.err.take_ptr()) }).into_native() })};
+ local_ret
+ }
+}
+
+// We're essentially a pointer already, or at least a set of pointers, so allow us to be used
+// directly as a Deref trait in higher-level structs:
+impl std::ops::Deref for Persist {
+ type Target = Self;
+ fn deref(&self) -> &Self {
+ self
+ }
+}
+/// Calls the free function if one is set
+#[no_mangle]
+pub extern "C" fn Persist_free(this_ptr: Persist) { }
+impl Drop for Persist {
+ fn drop(&mut self) {
+ if let Some(f) = self.free {
+ f(self.this_arg);
+ }
+ }
+}
}
#[no_mangle]
pub extern "C" fn SpendableOutputDescriptor_free(this_ptr: SpendableOutputDescriptor) { }
+#[no_mangle]
+pub extern "C" fn SpendableOutputDescriptor_clone(orig: &SpendableOutputDescriptor) -> SpendableOutputDescriptor {
+ orig.clone()
+}
/// Set of lightning keys needed to operate a channel as described in BOLT 3.
///
/// Signing services could be implemented on a hardware wallet. In this case,
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
unsafe impl Send for ChannelKeys {}
+#[no_mangle]
+pub extern "C" fn ChannelKeys_clone(orig: &ChannelKeys) -> ChannelKeys {
+ ChannelKeys {
+ this_arg: if let Some(f) = orig.clone { (f)(orig.this_arg) } else { orig.this_arg },
+ get_per_commitment_point: orig.get_per_commitment_point.clone(),
+ release_commitment_secret: orig.release_commitment_secret.clone(),
+ pubkeys: orig.pubkeys.clone(),
+ set_pubkeys: orig.set_pubkeys.clone(),
+ key_derivation_params: orig.key_derivation_params.clone(),
+ sign_counterparty_commitment: orig.sign_counterparty_commitment.clone(),
+ sign_holder_commitment: orig.sign_holder_commitment.clone(),
+ sign_holder_commitment_htlc_transactions: orig.sign_holder_commitment_htlc_transactions.clone(),
+ sign_justice_transaction: orig.sign_justice_transaction.clone(),
+ sign_counterparty_htlc_transaction: orig.sign_counterparty_htlc_transaction.clone(),
+ sign_closing_transaction: orig.sign_closing_transaction.clone(),
+ sign_channel_announcement: orig.sign_channel_announcement.clone(),
+ on_accept: orig.on_accept.clone(),
+ clone: orig.clone.clone(),
+ free: orig.free.clone(),
+ }
+}
impl Clone for ChannelKeys {
fn clone(&self) -> Self {
- Self {
- this_arg: if let Some(f) = self.clone { (f)(self.this_arg) } else { self.this_arg },
- get_per_commitment_point: self.get_per_commitment_point.clone(),
- release_commitment_secret: self.release_commitment_secret.clone(),
- pubkeys: self.pubkeys.clone(),
- set_pubkeys: self.set_pubkeys.clone(),
- key_derivation_params: self.key_derivation_params.clone(),
- sign_counterparty_commitment: self.sign_counterparty_commitment.clone(),
- sign_holder_commitment: self.sign_holder_commitment.clone(),
- sign_holder_commitment_htlc_transactions: self.sign_holder_commitment_htlc_transactions.clone(),
- sign_justice_transaction: self.sign_justice_transaction.clone(),
- sign_counterparty_htlc_transaction: self.sign_counterparty_htlc_transaction.clone(),
- sign_closing_transaction: self.sign_closing_transaction.clone(),
- sign_channel_announcement: self.sign_channel_announcement.clone(),
- on_accept: self.on_accept.clone(),
- clone: self.clone.clone(),
- free: self.free.clone(),
- }
+ ChannelKeys_clone(self)
}
}
pub(crate) extern "C" fn InMemoryChannelKeys_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInMemoryChannelKeys)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn InMemoryChannelKeys_clone(orig: &InMemoryChannelKeys) -> InMemoryChannelKeys {
+ InMemoryChannelKeys { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Private key of anchor tx
#[no_mangle]
pub extern "C" fn InMemoryChannelKeys_get_funding_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] {
}
}
}
+#[no_mangle]
+pub extern "C" fn AccessError_clone(orig: &AccessError) -> AccessError {
+ orig.clone()
+}
/// The `Access` trait defines behavior for accessing chain data and state, such as blocks and
/// UTXOs.
#[repr(C)]
pub(crate) extern "C" fn OutPoint_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOutPoint)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint {
+ OutPoint { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The referenced transaction's txid.
#[no_mangle]
pub extern "C" fn OutPoint_get_txid(this_ptr: &OutPoint) -> *const [u8; 32] {
pub(crate) extern "C" fn TxCreationKeys_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeTxCreationKeys)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn TxCreationKeys_clone(orig: &TxCreationKeys) -> TxCreationKeys {
+ TxCreationKeys { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The broadcaster's per-commitment public key which was used to derive the other keys.
#[no_mangle]
pub extern "C" fn TxCreationKeys_get_per_commitment_point(this_ptr: &TxCreationKeys) -> crate::c_types::PublicKey {
ret
}
}
+impl Clone for PreCalculatedTxCreationKeys {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn PreCalculatedTxCreationKeys_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePreCalculatedTxCreationKeys)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn PreCalculatedTxCreationKeys_clone(orig: &PreCalculatedTxCreationKeys) -> PreCalculatedTxCreationKeys {
+ PreCalculatedTxCreationKeys { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Create a new PreCalculatedTxCreationKeys from TxCreationKeys
#[must_use]
#[no_mangle]
pub(crate) extern "C" fn ChannelPublicKeys_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelPublicKeys)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelPublicKeys_clone(orig: &ChannelPublicKeys) -> ChannelPublicKeys {
+ ChannelPublicKeys { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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.
#[no_mangle]
pub(crate) extern "C" fn HTLCOutputInCommitment_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHTLCOutputInCommitment)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn HTLCOutputInCommitment_clone(orig: &HTLCOutputInCommitment) -> HTLCOutputInCommitment {
+ HTLCOutputInCommitment { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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
/// need to compare this value to whether the commitment transaction in question is that of
pub(crate) extern "C" fn HolderCommitmentTransaction_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeHolderCommitmentTransaction)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn HolderCommitmentTransaction_clone(orig: &HolderCommitmentTransaction) -> HolderCommitmentTransaction {
+ HolderCommitmentTransaction { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The commitment transaction itself, in unsigned form.
#[no_mangle]
pub extern "C" fn HolderCommitmentTransaction_get_unsigned_tx(this_ptr: &HolderCommitmentTransaction) -> crate::c_types::Transaction {
ret
}
}
+impl Clone for ChannelDetails {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelDetails_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelDetails)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn ChannelDetails_clone(orig: &ChannelDetails) -> ChannelDetails {
+ ChannelDetails { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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).
/// Note that this means this value is *not* persistent - it can change once during the
ret
}
}
+impl Clone for Init {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Init_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeInit)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Init_clone(orig: &Init) -> Init {
+ Init { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
use lightning::ln::msgs::ErrorMessage as nativeErrorMessageImport;
type nativeErrorMessage = nativeErrorMessageImport;
pub(crate) extern "C" fn ErrorMessage_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeErrorMessage)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ErrorMessage_clone(orig: &ErrorMessage) -> ErrorMessage {
+ ErrorMessage { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID involved in the error
#[no_mangle]
pub extern "C" fn ErrorMessage_get_channel_id(this_ptr: &ErrorMessage) -> *const [u8; 32] {
ret
}
}
+impl Clone for Ping {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Ping_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePing)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Ping_clone(orig: &Ping) -> Ping {
+ Ping { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The desired response length
#[no_mangle]
pub extern "C" fn Ping_get_ponglen(this_ptr: &Ping) -> u16 {
ret
}
}
+impl Clone for Pong {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn Pong_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativePong)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn Pong_clone(orig: &Pong) -> Pong {
+ Pong { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The pong packet size.
/// This field is not sent on the wire. byteslen zeros are sent.
#[no_mangle]
pub(crate) extern "C" fn OpenChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOpenChannel)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn OpenChannel_clone(orig: &OpenChannel) -> OpenChannel {
+ OpenChannel { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain where the channel is to be opened
#[no_mangle]
pub extern "C" fn OpenChannel_get_chain_hash(this_ptr: &OpenChannel) -> *const [u8; 32] {
pub(crate) extern "C" fn AcceptChannel_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAcceptChannel)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn AcceptChannel_clone(orig: &AcceptChannel) -> AcceptChannel {
+ AcceptChannel { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// A temporary channel ID, until the funding outpoint is announced
#[no_mangle]
pub extern "C" fn AcceptChannel_get_temporary_channel_id(this_ptr: &AcceptChannel) -> *const [u8; 32] {
pub(crate) extern "C" fn FundingCreated_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingCreated)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn FundingCreated_clone(orig: &FundingCreated) -> FundingCreated {
+ FundingCreated { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// A temporary channel ID, until the funding is established
#[no_mangle]
pub extern "C" fn FundingCreated_get_temporary_channel_id(this_ptr: &FundingCreated) -> *const [u8; 32] {
pub(crate) extern "C" fn FundingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingSigned)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn FundingSigned_clone(orig: &FundingSigned) -> FundingSigned {
+ FundingSigned { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn FundingSigned_get_channel_id(this_ptr: &FundingSigned) -> *const [u8; 32] {
pub(crate) extern "C" fn FundingLocked_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeFundingLocked)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn FundingLocked_clone(orig: &FundingLocked) -> FundingLocked {
+ FundingLocked { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn FundingLocked_get_channel_id(this_ptr: &FundingLocked) -> *const [u8; 32] {
pub(crate) extern "C" fn Shutdown_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeShutdown)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn Shutdown_clone(orig: &Shutdown) -> Shutdown {
+ Shutdown { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn Shutdown_get_channel_id(this_ptr: &Shutdown) -> *const [u8; 32] {
pub(crate) extern "C" fn ClosingSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeClosingSigned)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ClosingSigned_clone(orig: &ClosingSigned) -> ClosingSigned {
+ ClosingSigned { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn ClosingSigned_get_channel_id(this_ptr: &ClosingSigned) -> *const [u8; 32] {
pub(crate) extern "C" fn UpdateAddHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateAddHTLC)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UpdateAddHTLC_clone(orig: &UpdateAddHTLC) -> UpdateAddHTLC {
+ UpdateAddHTLC { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn UpdateAddHTLC_get_channel_id(this_ptr: &UpdateAddHTLC) -> *const [u8; 32] {
pub(crate) extern "C" fn UpdateFulfillHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFulfillHTLC)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UpdateFulfillHTLC_clone(orig: &UpdateFulfillHTLC) -> UpdateFulfillHTLC {
+ UpdateFulfillHTLC { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn UpdateFulfillHTLC_get_channel_id(this_ptr: &UpdateFulfillHTLC) -> *const [u8; 32] {
pub(crate) extern "C" fn UpdateFailHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailHTLC)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UpdateFailHTLC_clone(orig: &UpdateFailHTLC) -> UpdateFailHTLC {
+ UpdateFailHTLC { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn UpdateFailHTLC_get_channel_id(this_ptr: &UpdateFailHTLC) -> *const [u8; 32] {
pub(crate) extern "C" fn UpdateFailMalformedHTLC_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFailMalformedHTLC)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UpdateFailMalformedHTLC_clone(orig: &UpdateFailMalformedHTLC) -> UpdateFailMalformedHTLC {
+ UpdateFailMalformedHTLC { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn UpdateFailMalformedHTLC_get_channel_id(this_ptr: &UpdateFailMalformedHTLC) -> *const [u8; 32] {
pub(crate) extern "C" fn CommitmentSigned_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentSigned)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn CommitmentSigned_clone(orig: &CommitmentSigned) -> CommitmentSigned {
+ CommitmentSigned { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn CommitmentSigned_get_channel_id(this_ptr: &CommitmentSigned) -> *const [u8; 32] {
pub(crate) extern "C" fn RevokeAndACK_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRevokeAndACK)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn RevokeAndACK_clone(orig: &RevokeAndACK) -> RevokeAndACK {
+ RevokeAndACK { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn RevokeAndACK_get_channel_id(this_ptr: &RevokeAndACK) -> *const [u8; 32] {
pub(crate) extern "C" fn UpdateFee_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUpdateFee)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UpdateFee_clone(orig: &UpdateFee) -> UpdateFee {
+ UpdateFee { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn UpdateFee_get_channel_id(this_ptr: &UpdateFee) -> *const [u8; 32] {
pub(crate) extern "C" fn DataLossProtect_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeDataLossProtect)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn DataLossProtect_clone(orig: &DataLossProtect) -> DataLossProtect {
+ DataLossProtect { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Proof that the sender knows the per-commitment secret of a specific commitment transaction
/// belonging to the recipient
#[no_mangle]
pub(crate) extern "C" fn ChannelReestablish_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelReestablish)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelReestablish_clone(orig: &ChannelReestablish) -> ChannelReestablish {
+ ChannelReestablish { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn ChannelReestablish_get_channel_id(this_ptr: &ChannelReestablish) -> *const [u8; 32] {
pub(crate) extern "C" fn AnnouncementSignatures_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeAnnouncementSignatures)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn AnnouncementSignatures_clone(orig: &AnnouncementSignatures) -> AnnouncementSignatures {
+ AnnouncementSignatures { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The channel ID
#[no_mangle]
pub extern "C" fn AnnouncementSignatures_get_channel_id(this_ptr: &AnnouncementSignatures) -> *const [u8; 32] {
}
#[no_mangle]
pub extern "C" fn NetAddress_free(this_ptr: NetAddress) { }
+#[no_mangle]
+pub extern "C" fn NetAddress_clone(orig: &NetAddress) -> NetAddress {
+ orig.clone()
+}
use lightning::ln::msgs::UnsignedNodeAnnouncement as nativeUnsignedNodeAnnouncementImport;
type nativeUnsignedNodeAnnouncement = nativeUnsignedNodeAnnouncementImport;
pub(crate) extern "C" fn UnsignedNodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedNodeAnnouncement)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UnsignedNodeAnnouncement_clone(orig: &UnsignedNodeAnnouncement) -> UnsignedNodeAnnouncement {
+ UnsignedNodeAnnouncement { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The advertised features
#[no_mangle]
pub extern "C" fn UnsignedNodeAnnouncement_get_features(this_ptr: &UnsignedNodeAnnouncement) -> crate::ln::features::NodeFeatures {
pub(crate) extern "C" fn NodeAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeNodeAnnouncement)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn NodeAnnouncement_clone(orig: &NodeAnnouncement) -> NodeAnnouncement {
+ NodeAnnouncement { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The signature by the node key
#[no_mangle]
pub extern "C" fn NodeAnnouncement_get_signature(this_ptr: &NodeAnnouncement) -> crate::c_types::Signature {
pub(crate) extern "C" fn UnsignedChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelAnnouncement)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelAnnouncement_clone(orig: &UnsignedChannelAnnouncement) -> UnsignedChannelAnnouncement {
+ UnsignedChannelAnnouncement { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The advertised channel features
#[no_mangle]
pub extern "C" fn UnsignedChannelAnnouncement_get_features(this_ptr: &UnsignedChannelAnnouncement) -> crate::ln::features::ChannelFeatures {
pub(crate) extern "C" fn ChannelAnnouncement_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelAnnouncement)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelAnnouncement_clone(orig: &ChannelAnnouncement) -> ChannelAnnouncement {
+ ChannelAnnouncement { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Authentication of the announcement by the first public node
#[no_mangle]
pub extern "C" fn ChannelAnnouncement_get_node_signature_1(this_ptr: &ChannelAnnouncement) -> crate::c_types::Signature {
pub(crate) extern "C" fn UnsignedChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUnsignedChannelUpdate)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UnsignedChannelUpdate_clone(orig: &UnsignedChannelUpdate) -> UnsignedChannelUpdate {
+ UnsignedChannelUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain where the channel is to be opened
#[no_mangle]
pub extern "C" fn UnsignedChannelUpdate_get_chain_hash(this_ptr: &UnsignedChannelUpdate) -> *const [u8; 32] {
pub(crate) extern "C" fn ChannelUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelUpdate)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelUpdate_clone(orig: &ChannelUpdate) -> ChannelUpdate {
+ ChannelUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// A signature of the channel update
#[no_mangle]
pub extern "C" fn ChannelUpdate_get_signature(this_ptr: &ChannelUpdate) -> crate::c_types::Signature {
pub(crate) extern "C" fn QueryChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryChannelRange)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn QueryChannelRange_clone(orig: &QueryChannelRange) -> QueryChannelRange {
+ QueryChannelRange { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain being queried
#[no_mangle]
pub extern "C" fn QueryChannelRange_get_chain_hash(this_ptr: &QueryChannelRange) -> *const [u8; 32] {
pub(crate) extern "C" fn ReplyChannelRange_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyChannelRange)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ReplyChannelRange_clone(orig: &ReplyChannelRange) -> ReplyChannelRange {
+ ReplyChannelRange { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain being queried
#[no_mangle]
pub extern "C" fn ReplyChannelRange_get_chain_hash(this_ptr: &ReplyChannelRange) -> *const [u8; 32] {
pub(crate) extern "C" fn QueryShortChannelIds_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeQueryShortChannelIds)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn QueryShortChannelIds_clone(orig: &QueryShortChannelIds) -> QueryShortChannelIds {
+ QueryShortChannelIds { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain being queried
#[no_mangle]
pub extern "C" fn QueryShortChannelIds_get_chain_hash(this_ptr: &QueryShortChannelIds) -> *const [u8; 32] {
pub(crate) extern "C" fn ReplyShortChannelIdsEnd_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeReplyShortChannelIdsEnd)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ReplyShortChannelIdsEnd_clone(orig: &ReplyShortChannelIdsEnd) -> ReplyShortChannelIdsEnd {
+ ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain that was queried
#[no_mangle]
pub extern "C" fn ReplyShortChannelIdsEnd_get_chain_hash(this_ptr: &ReplyShortChannelIdsEnd) -> *const [u8; 32] {
pub(crate) extern "C" fn GossipTimestampFilter_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeGossipTimestampFilter)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn GossipTimestampFilter_clone(orig: &GossipTimestampFilter) -> GossipTimestampFilter {
+ GossipTimestampFilter { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The genesis hash of the blockchain for channel and node information
#[no_mangle]
pub extern "C" fn GossipTimestampFilter_get_chain_hash(this_ptr: &GossipTimestampFilter) -> *const [u8; 32] {
}
#[no_mangle]
pub extern "C" fn ErrorAction_free(this_ptr: ErrorAction) { }
+#[no_mangle]
+pub extern "C" fn ErrorAction_clone(orig: &ErrorAction) -> ErrorAction {
+ orig.clone()
+}
use lightning::ln::msgs::LightningError as nativeLightningErrorImport;
type nativeLightningError = nativeLightningErrorImport;
pub(crate) extern "C" fn CommitmentUpdate_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeCommitmentUpdate)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn CommitmentUpdate_clone(orig: &CommitmentUpdate) -> CommitmentUpdate {
+ CommitmentUpdate { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// update_add_htlc messages which should be sent
#[no_mangle]
pub extern "C" fn CommitmentUpdate_set_update_add_htlcs(this_ptr: &mut CommitmentUpdate, mut val: crate::c_types::derived::CVec_UpdateAddHTLCZ) {
}
#[no_mangle]
pub extern "C" fn HTLCFailChannelUpdate_free(this_ptr: HTLCFailChannelUpdate) { }
+#[no_mangle]
+pub extern "C" fn HTLCFailChannelUpdate_clone(orig: &HTLCFailChannelUpdate) -> HTLCFailChannelUpdate {
+ orig.clone()
+}
/// A trait to describe an object which can receive channel messages.
///
/// Messages MAY be called in parallel when they originate from different their_node_ids, however
/// though races may occur whereby disconnect_socket is called after a call to
/// socket_disconnected but prior to socket_disconnected returning.
pub disconnect_socket: extern "C" fn (this_arg: *mut c_void),
- pub eq: extern "C" fn (this_arg: *const c_void, other_arg: *const c_void) -> bool,
+ pub eq: extern "C" fn (this_arg: *const c_void, other_arg: &SocketDescriptor) -> bool,
pub hash: extern "C" fn (this_arg: *const c_void) -> u64,
pub clone: Option<extern "C" fn (this_arg: *const c_void) -> *mut c_void>,
pub free: Option<extern "C" fn(this_arg: *mut c_void)>,
}
impl std::cmp::Eq for SocketDescriptor {}
impl std::cmp::PartialEq for SocketDescriptor {
- fn eq(&self, o: &Self) -> bool { (self.eq)(self.this_arg, o.this_arg) }
+ fn eq(&self, o: &Self) -> bool { (self.eq)(self.this_arg, o) }
}
impl std::hash::Hash for SocketDescriptor {
fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) { hasher.write_u64((self.hash)(self.this_arg)) }
}
+#[no_mangle]
+pub extern "C" fn SocketDescriptor_clone(orig: &SocketDescriptor) -> SocketDescriptor {
+ SocketDescriptor {
+ this_arg: if let Some(f) = orig.clone { (f)(orig.this_arg) } else { orig.this_arg },
+ send_data: orig.send_data.clone(),
+ disconnect_socket: orig.disconnect_socket.clone(),
+ eq: orig.eq.clone(),
+ hash: orig.hash.clone(),
+ clone: orig.clone.clone(),
+ free: orig.free.clone(),
+ }
+}
impl Clone for SocketDescriptor {
fn clone(&self) -> Self {
- Self {
- this_arg: if let Some(f) = self.clone { (f)(self.this_arg) } else { self.this_arg },
- send_data: self.send_data.clone(),
- disconnect_socket: self.disconnect_socket.clone(),
- eq: self.eq.clone(),
- hash: self.hash.clone(),
- clone: self.clone.clone(),
- free: self.free.clone(),
- }
+ SocketDescriptor_clone(self)
}
}
pub(crate) extern "C" fn RoutingFees_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoutingFees)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn RoutingFees_clone(orig: &RoutingFees) -> RoutingFees {
+ RoutingFees { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Flat routing fee in satoshis
#[no_mangle]
pub extern "C" fn RoutingFees_get_base_msat(this_ptr: &RoutingFees) -> u32 {
pub(crate) extern "C" fn RouteHop_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHop)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn RouteHop_clone(orig: &RouteHop) -> RouteHop {
+ RouteHop { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The node_id of the node at this hop.
#[no_mangle]
pub extern "C" fn RouteHop_get_pubkey(this_ptr: &RouteHop) -> crate::c_types::PublicKey {
pub(crate) extern "C" fn Route_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRoute)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn Route_clone(orig: &Route) -> Route {
+ Route { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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.
/// Each entry represents a list of hops, NOT INCLUDING our own, where the last hop is the
ret
}
}
+impl Clone for RouteHint {
+ fn clone(&self) -> Self {
+ Self {
+ inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ is_owned: true,
+ }
+ }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn RouteHint_clone_void(this_ptr: *const c_void) -> *mut c_void {
+ Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeRouteHint)).clone() })) as *mut c_void
+}
+#[no_mangle]
+pub extern "C" fn RouteHint_clone(orig: &RouteHint) -> RouteHint {
+ RouteHint { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// The node_id of the non-target end of the route
#[no_mangle]
pub extern "C" fn RouteHint_get_src_node_id(this_ptr: &RouteHint) -> crate::c_types::PublicKey {
pub(crate) extern "C" fn ChannelHandshakeConfig_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeConfig)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeConfig_clone(orig: &ChannelHandshakeConfig) -> ChannelHandshakeConfig {
+ ChannelHandshakeConfig { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Confirmations we will wait for before considering the channel locked in.
/// Applied only for inbound channels (see ChannelHandshakeLimits::max_minimum_depth for the
/// equivalent limit applied to outbound channels).
pub(crate) extern "C" fn ChannelHandshakeLimits_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelHandshakeLimits)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelHandshakeLimits_clone(orig: &ChannelHandshakeLimits) -> ChannelHandshakeLimits {
+ ChannelHandshakeLimits { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Minimum allowed satoshis when a channel is funded, this is supplied by the sender and so
/// only applies to inbound channels.
///
pub(crate) extern "C" fn ChannelConfig_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelConfig)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn ChannelConfig_clone(orig: &ChannelConfig) -> ChannelConfig {
+ ChannelConfig { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// 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
/// update messages sent to notify all nodes of our updated relay fee.
pub(crate) extern "C" fn UserConfig_clone_void(this_ptr: *const c_void) -> *mut c_void {
Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeUserConfig)).clone() })) as *mut c_void
}
+#[no_mangle]
+pub extern "C" fn UserConfig_clone(orig: &UserConfig) -> UserConfig {
+ UserConfig { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
/// Channel config that we propose to our counterparty.
#[no_mangle]
pub extern "C" fn UserConfig_get_own_channel_config(this_ptr: &UserConfig) -> crate::util::config::ChannelHandshakeConfig {
}
#[no_mangle]
pub extern "C" fn APIError_free(this_ptr: APIError) { }
+#[no_mangle]
+pub extern "C" fn APIError_clone(orig: &APIError) -> APIError {
+ orig.clone()
+}
}
#[no_mangle]
pub extern "C" fn Event_free(this_ptr: Event) { }
+#[no_mangle]
+pub extern "C" fn Event_clone(orig: &Event) -> Event {
+ orig.clone()
+}
/// An event generated by ChannelManager which indicates a message should be sent to a peer (or
/// broadcast to most peers).
/// These events are handled by PeerManager::process_events if you are using a PeerManager.
}
#[no_mangle]
pub extern "C" fn MessageSendEvent_free(this_ptr: MessageSendEvent) { }
+#[no_mangle]
+pub extern "C" fn MessageSendEvent_clone(orig: &MessageSendEvent) -> MessageSendEvent {
+ orig.clone()
+}
/// A trait indicating an object may generate message send events
#[repr(C)]
pub struct MessageSendEventsProvider {
}
}
}
+#[no_mangle]
+pub extern "C" fn Level_clone(orig: &Level) -> Level {
+ orig.clone()
+}
/// Returns the most verbose logging level.
#[must_use]
#[no_mangle]