From: Matt Corallo Date: Mon, 14 Sep 2020 19:52:33 +0000 (-0400) Subject: Update bindings after merge of #633, #679, #683. X-Git-Tag: v0.0.12~24^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=49e0a8ce7b2f8482ceca97049cf0f1471b7aa524;p=rust-lightning Update bindings after merge of #633, #679, #683. --- diff --git a/lightning-c-bindings/include/lightning.h b/lightning-c-bindings/include/lightning.h index 23efa9db6..7c4be60da 100644 --- a/lightning-c-bindings/include/lightning.h +++ b/lightning-c-bindings/include/lightning.h @@ -40,7 +40,7 @@ typedef enum LDKChannelMonitorUpdateErr { * our state failed, but is expected to succeed at some point in the future). * * Such a failure will \"freeze\" a channel, preventing us from revoking old states or - * submitting new commitment transactions to the remote party. Once the update(s) which failed + * submitting new commitment transactions to the counterparty. Once the update(s) which failed * have been successfully applied, ChannelManager::channel_monitor_updated can be used to * restore the channel to an operational state. * @@ -75,11 +75,19 @@ typedef enum LDKChannelMonitorUpdateErr { /** * Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a * different watchtower and cannot update with all watchtowers that were previously informed - * of this channel). This will force-close the channel in question (which will generate one - * final ChannelMonitorUpdate which must be delivered to at least one ChannelMonitor copy). + * of this channel). * - * Should also be used to indicate a failure to update the local persisted copy of the channel - * monitor. + * At reception of this error, ChannelManager will force-close the channel and return at + * least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at + * least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel + * update must be rejected. + * + * This failure may also signal a failure to update the local persisted copy of one of + * the channel monitor instance. + * + * Note that even when you fail a holder commitment transaction update, you must store the + * update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor + * broadcasts it (e.g distributed channel-monitor deployment) */ LDKChannelMonitorUpdateErr_PermanentFailure, /** @@ -571,14 +579,14 @@ typedef enum LDKSpendableOutputDescriptor_Tag { * it is an output from an old state which we broadcast (which should never happen). * * To derive the delayed_payment key which is used to sign for this input, you must pass the - * local delayed_payment_base_key (ie the private key which corresponds to the pubkey in + * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in * ChannelKeys::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to * chan_utils::derive_private_key. The public key can be generated without the secret key * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in * ChannelKeys::pubkeys(). * - * To derive the remote_revocation_pubkey provided here (which is used in the witness - * script generation), you must pass the remote revocation_basepoint (which appears in the + * To derive the revocation_pubkey provided here (which is used in the witness + * script generation), you must pass the counterparty revocation_basepoint (which appears in the * call to ChannelKeys::on_accept) and the provided per_commitment point * to chan_utils::derive_public_revocation_key. * @@ -597,7 +605,7 @@ typedef enum LDKSpendableOutputDescriptor_Tag { * These are generally the result of our counterparty having broadcast the current state, * allowing us to claim the non-HTLC-encumbered outputs immediately. */ - LDKSpendableOutputDescriptor_StaticOutputRemotePayment, + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment, /** * Must be last for serialization purposes */ @@ -615,21 +623,21 @@ typedef struct LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body { uint16_t to_self_delay; LDKTxOut output; LDKC2Tuple_u64u64Z key_derivation_params; - LDKPublicKey remote_revocation_pubkey; + LDKPublicKey revocation_pubkey; } LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body; -typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputRemotePayment_Body { +typedef struct LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body { LDKOutPoint outpoint; LDKTxOut output; LDKC2Tuple_u64u64Z key_derivation_params; -} LDKSpendableOutputDescriptor_LDKStaticOutputRemotePayment_Body; +} LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body; typedef struct LDKSpendableOutputDescriptor { LDKSpendableOutputDescriptor_Tag tag; union { LDKSpendableOutputDescriptor_LDKStaticOutput_Body static_output; LDKSpendableOutputDescriptor_LDKDynamicOutputP2WSH_Body dynamic_output_p2wsh; - LDKSpendableOutputDescriptor_LDKStaticOutputRemotePayment_Body static_output_remote_payment; + LDKSpendableOutputDescriptor_LDKStaticOutputCounterpartyPayment_Body static_output_counterparty_payment; }; } LDKSpendableOutputDescriptor; @@ -1582,18 +1590,18 @@ typedef LDKCVecTempl_HTLCOutputInCommitment LDKCVec_HTLCOutputInCommitmentZ; /** - * We use this to track local commitment transactions and put off signing them until we are ready + * We use this to track holder commitment transactions and put off signing them until we are ready * to broadcast. This class can be used inside a signer implementation to generate a signature * given the relevant secret key. */ -typedef struct MUST_USE_STRUCT LDKLocalCommitmentTransaction { +typedef struct MUST_USE_STRUCT LDKHolderCommitmentTransaction { /** * Nearly everyhwere, inner must be non-null, however in places where * the Rust equivalent takes an Option, it may be set to null to indicate None. */ - LDKnativeLocalCommitmentTransaction *inner; + LDKnativeHolderCommitmentTransaction *inner; bool is_owned; -} LDKLocalCommitmentTransaction; +} LDKHolderCommitmentTransaction; @@ -1654,7 +1662,7 @@ typedef struct LDKChannelKeys { */ LDKThirtyTwoBytes (*release_commitment_secret)(const void *this_arg, uint64_t idx); /** - * Gets the local channel public keys and basepoints + * Gets the holder's channel public keys and basepoints */ LDKChannelPublicKeys pubkeys; /** @@ -1670,34 +1678,34 @@ typedef struct LDKChannelKeys { */ LDKC2Tuple_u64u64Z (*key_derivation_params)(const void *this_arg); /** - * Create a signature for a remote commitment transaction and associated HTLC transactions. + * Create a signature for a counterparty's commitment transaction and associated HTLC transactions. * * Note that if signing fails or is rejected, the channel will be force-closed. */ - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_remote_commitment)(const void *this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ (*sign_counterparty_commitment)(const void *this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs); /** - * Create a signature for a local commitment transaction. This will only ever be called with - * the same local_commitment_tx (or a copy thereof), though there are currently no guarantees + * Create a signature for a holder's commitment transaction. This will only ever be called with + * the same holder_commitment_tx (or a copy thereof), though there are currently no guarantees * that it will not be called multiple times. * An external signer implementation should check that the commitment has not been revoked. */ - LDKCResult_SignatureNoneZ (*sign_local_commitment)(const void *this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx); + LDKCResult_SignatureNoneZ (*sign_holder_commitment)(const void *this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx); /** - * Create a signature for each HTLC transaction spending a local commitment transaction. + * Create a signature for each HTLC transaction spending a holder's commitment transaction. * - * Unlike sign_local_commitment, this may be called multiple times with *different* - * local_commitment_tx values. While this will never be called with a revoked - * local_commitment_tx, it is possible that it is called with the second-latest - * local_commitment_tx (only if we haven't yet revoked it) if some watchtower/secondary + * Unlike sign_holder_commitment, this may be called multiple times with *different* + * holder_commitment_tx values. While this will never be called with a revoked + * holder_commitment_tx, it is possible that it is called with the second-latest + * holder_commitment_tx (only if we haven't yet revoked it) if some watchtower/secondary * ChannelMonitor decided to broadcast before it had been updated to the latest. * * Either an Err should be returned, or a Vec with one entry for each HTLC which exists in - * local_commitment_tx. For those HTLCs which have transaction_output_index set to None + * holder_commitment_tx. For those HTLCs which have transaction_output_index set to None * (implying they were considered dust at the time the commitment transaction was negotiated), * a corresponding None should be included in the return value. All other positions in the * return value must contain a signature. */ - LDKCResult_CVec_SignatureZNoneZ (*sign_local_commitment_htlc_transactions)(const void *this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx); + LDKCResult_CVec_SignatureZNoneZ (*sign_holder_commitment_htlc_transactions)(const void *this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx); /** * Create a signature for the given input in a transaction spending an HTLC or commitment * transaction output when our counterparty broadcasts an old state. @@ -1710,8 +1718,8 @@ typedef struct LDKChannelKeys { * Amount is value of the output spent by this input, committed to in the BIP 143 signature. * * per_commitment_key is revocation secret which was provided by our counterparty when they - * revoked the state which they eventually broadcast. It's not a _local_ secret key and does - * not allow the spending of any funds by itself (you need our local revocation_secret to do + * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + * not allow the spending of any funds by itself (you need our holder revocation_secret to do * so). * * htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus @@ -1720,7 +1728,7 @@ typedef struct LDKChannelKeys { */ LDKCResult_SignatureNoneZ (*sign_justice_transaction)(const void *this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const LDKHTLCOutputInCommitment *htlc); /** - * Create a signature for a claiming transaction for a HTLC output on a remote commitment + * Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment * transaction, either offered or received. * * Such a transaction may claim multiples offered outputs at same time if we know the @@ -1738,7 +1746,7 @@ typedef struct LDKChannelKeys { * channel state keys, which are then included in the witness script and committed to in the * BIP 143 signature. */ - LDKCResult_SignatureNoneZ (*sign_remote_htlc_transaction)(const void *this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc); + LDKCResult_SignatureNoneZ (*sign_counterparty_htlc_transaction)(const void *this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc); /** * Create a signature for a (proposed) closing transaction. * @@ -1756,14 +1764,14 @@ typedef struct LDKChannelKeys { */ LDKCResult_SignatureNoneZ (*sign_channel_announcement)(const void *this_arg, const LDKUnsignedChannelAnnouncement *msg); /** - * Set the remote channel basepoints and remote/local to_self_delay. + * Set the counterparty channel basepoints and counterparty_selected/holder_selected_contest_delay. * This is done immediately on incoming channels and as soon as the channel is accepted on outgoing channels. * - * We bind local_to_self_delay late here for API convenience. + * We bind holder_selected_contest_delay late here for API convenience. * * Will be called before any signatures are applied. */ - void (*on_accept)(void *this_arg, const LDKChannelPublicKeys *channel_points, uint16_t remote_to_self_delay, uint16_t local_to_self_delay); + void (*on_accept)(void *this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay); void *(*clone)(const void *this_arg); void (*free)(void *this_arg); } LDKChannelKeys; @@ -1950,6 +1958,11 @@ typedef struct LDKManyChannelMonitor { * * Any spends of outputs which should have been registered which aren't passed to * ChannelMonitors via block_connected may result in FUNDS LOSS. + * + * In case of distributed watchtowers deployment, even if an Err is return, the new version + * must be written to disk, as state may have been stored but rejected due to a block forcing + * a commitment broadcast. This storage is used to claim outputs of rejected state confirmed + * onchain by another watchtower, lagging behind on block processing. */ LDKCResult_NoneChannelMonitorUpdateErrZ (*update_monitor)(const void *this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate monitor); /** @@ -2474,6 +2487,104 @@ typedef struct MUST_USE_STRUCT LDKUnsignedChannelUpdate { +/** + * A query_channel_range message is used to query a peer for channel + * UTXOs in a range of blocks. The recipient of a query makes a best + * effort to reply to the query using one or more reply_channel_range + * messages. + */ +typedef struct MUST_USE_STRUCT LDKQueryChannelRange { + /** + * Nearly everyhwere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeQueryChannelRange *inner; + bool is_owned; +} LDKQueryChannelRange; + + + +/** + * A reply_channel_range message is a reply to a query_channel_range + * message. Multiple reply_channel_range messages can be sent in reply + * to a single query_channel_range message. The query recipient makes a + * best effort to respond based on their local network view which may + * not be a perfect view of the network. The short_channel_ids in the + * reply are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ +typedef struct MUST_USE_STRUCT LDKReplyChannelRange { + /** + * Nearly everyhwere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeReplyChannelRange *inner; + bool is_owned; +} LDKReplyChannelRange; + +typedef struct LDKCVecTempl_u64 { + uint64_t *data; + uintptr_t datalen; +} LDKCVecTempl_u64; + +typedef LDKCVecTempl_u64 LDKCVec_u64Z; + + + +/** + * A query_short_channel_ids message is used to query a peer for + * routing gossip messages related to one or more short_channel_ids. + * The query recipient will reply with the latest, if available, + * channel_announcement, channel_update and node_announcement messages + * it maintains for the requested short_channel_ids followed by a + * reply_short_channel_ids_end message. The short_channel_ids sent in + * this query are encoded. We only support encoding_type=0 uncompressed + * serialization and do not support encoding_type=1 zlib serialization. + */ +typedef struct MUST_USE_STRUCT LDKQueryShortChannelIds { + /** + * Nearly everyhwere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeQueryShortChannelIds *inner; + bool is_owned; +} LDKQueryShortChannelIds; + + + +/** + * A reply_short_channel_ids_end message is sent as a reply to a + * query_short_channel_ids message. The query recipient makes a best + * effort to respond based on their local network view which may not be + * a perfect view of the network. + */ +typedef struct MUST_USE_STRUCT LDKReplyShortChannelIdsEnd { + /** + * Nearly everyhwere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeReplyShortChannelIdsEnd *inner; + bool is_owned; +} LDKReplyShortChannelIdsEnd; + + + +/** + * A gossip_timestamp_filter message is used by a node to request + * gossip relay for messages in the requested time range when the + * gossip_queries feature has been negotiated. + */ +typedef struct MUST_USE_STRUCT LDKGossipTimestampFilter { + /** + * Nearly everyhwere, inner must be non-null, however in places where + * the Rust equivalent takes an Option, it may be set to null to indicate None. + */ + LDKnativeGossipTimestampFilter *inner; + bool is_owned; +} LDKGossipTimestampFilter; + + + /** * An Err type for failure to process messages. */ @@ -2726,6 +2837,10 @@ typedef LDKCResultTempl_PublicKey__Secp256k1Error LDKCResult_PublicKeySecpErrorZ * The set of public keys which are used in the creation of one commitment transaction. * These are derived from the channel base keys and per-commitment data. * + * A broadcaster key is provided from potential broadcaster of the computed transaction. + * A countersignatory key is coming from a protocol participant unable to broadcast the + * transaction. + * * These keys are assumed to be good, either because the code derived them from * channel basepoints via the new function, or they were obtained via * PreCalculatedTxCreationKeys.trust_key_derivation because we trusted the source of the @@ -2966,13 +3081,6 @@ typedef struct MUST_USE_STRUCT LDKNodeInfo { bool is_owned; } LDKNodeInfo; -typedef struct LDKCVecTempl_u64 { - uint64_t *data; - uintptr_t datalen; -} LDKCVecTempl_u64; - -typedef LDKCVecTempl_u64 LDKCVec_u64Z; - typedef LDKCVecTempl_RouteHop LDKCVec_RouteHopZ; extern const void (*C2Tuple_HTLCOutputInCommitmentSignatureZ_free)(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ); @@ -3728,42 +3836,42 @@ const uint8_t (*InMemoryChannelKeys_get_funding_key(const LDKInMemoryChannelKeys void InMemoryChannelKeys_set_funding_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); /** - * Local secret key for blinded revocation pubkey + * Holder secret key for blinded revocation pubkey */ const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; /** - * Local secret key for blinded revocation pubkey + * Holder secret key for blinded revocation pubkey */ void InMemoryChannelKeys_set_revocation_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); /** - * Local secret key used for our balance in remote-broadcasted commitment transactions + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions */ const uint8_t (*InMemoryChannelKeys_get_payment_key(const LDKInMemoryChannelKeys *this_ptr))[32]; /** - * Local secret key used for our balance in remote-broadcasted commitment transactions + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions */ void InMemoryChannelKeys_set_payment_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); /** - * Local secret key used in HTLC tx + * Holder secret key used in HTLC tx */ const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; /** - * Local secret key used in HTLC tx + * Holder secret key used in HTLC tx */ void InMemoryChannelKeys_set_delayed_payment_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); /** - * Local htlc secret key used in commitment tx htlc outputs + * Holder htlc secret key used in commitment tx htlc outputs */ const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const LDKInMemoryChannelKeys *this_ptr))[32]; /** - * Local htlc secret key used in commitment tx htlc outputs + * Holder htlc secret key used in commitment tx htlc outputs */ void InMemoryChannelKeys_set_htlc_base_key(LDKInMemoryChannelKeys *this_ptr, LDKSecretKey val); @@ -3783,27 +3891,27 @@ void InMemoryChannelKeys_set_commitment_seed(LDKInMemoryChannelKeys *this_ptr, L MUST_USE_RES LDKInMemoryChannelKeys InMemoryChannelKeys_new(LDKSecretKey funding_key, LDKSecretKey revocation_base_key, LDKSecretKey payment_key, LDKSecretKey delayed_payment_base_key, LDKSecretKey htlc_base_key, LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, LDKC2Tuple_u64u64Z key_derivation_params); /** - * Remote pubkeys. + * Counterparty pubkeys. * Will panic if on_accept wasn't called. */ -MUST_USE_RES LDKChannelPublicKeys InMemoryChannelKeys_remote_pubkeys(const LDKInMemoryChannelKeys *this_arg); +MUST_USE_RES LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const LDKInMemoryChannelKeys *this_arg); /** - * The to_self_delay value specified by our counterparty and applied on locally-broadcastable + * The contest_delay value specified by our counterparty and applied on holder-broadcastable * transactions, ie the amount of time that we have to wait to recover our funds if we * broadcast a transaction. You'll likely want to pass this to the - * ln::chan_utils::build*_transaction functions when signing local transactions. + * ln::chan_utils::build*_transaction functions when signing holder's transactions. * Will panic if on_accept wasn't called. */ -MUST_USE_RES uint16_t InMemoryChannelKeys_remote_to_self_delay(const LDKInMemoryChannelKeys *this_arg); +MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const LDKInMemoryChannelKeys *this_arg); /** - * The to_self_delay value specified by us and applied on transactions broadcastable + * The contest_delay value specified by us and applied on transactions broadcastable * by our counterparty, ie the amount of time that they have to wait to recover their funds * if they broadcast a transaction. * Will panic if on_accept wasn't called. */ -MUST_USE_RES uint16_t InMemoryChannelKeys_local_to_self_delay(const LDKInMemoryChannelKeys *this_arg); +MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const LDKInMemoryChannelKeys *this_arg); LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const LDKInMemoryChannelKeys *this_arg); @@ -4360,17 +4468,17 @@ MUST_USE_RES LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_ MUST_USE_RES LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(LDKChannelMonitor *this_arg); /** - * Used by ChannelManager deserialization to broadcast the latest local state if its copy of - * the Channel was out-of-date. You may use it to get a broadcastable local toxic tx in case of - * fallen-behind, i.e when receiving a channel_reestablish with a proof that our remote side knows - * a higher revocation secret than the local commitment number we are aware of. Broadcasting these - * transactions are UNSAFE, as they allow remote side to punish you. Nevertheless you may want to - * broadcast them if remote don't close channel with his higher commitment transaction after a + * Used by ChannelManager deserialization to broadcast the latest holder state if its copy of + * the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of + * fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows + * a higher revocation secret than the holder commitment number we are aware of. Broadcasting these + * transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to + * broadcast them if counterparty don't close channel with his higher commitment transaction after a * substantial amount of time (a month or even a year) to get back funds. Best may be to contact * out-of-band the other node operator to coordinate with him if option is available to you. * In any-case, choice is up to the user. */ -MUST_USE_RES LDKCVec_TransactionZ ChannelMonitor_get_latest_local_commitment_txn(LDKChannelMonitor *this_arg, const LDKLogger *logger); +MUST_USE_RES LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(LDKChannelMonitor *this_arg, const LDKLogger *logger); void DecodeError_free(LDKDecodeError this_ptr); @@ -5552,6 +5660,170 @@ void ChannelUpdate_set_contents(LDKChannelUpdate *this_ptr, LDKUnsignedChannelUp MUST_USE_RES LDKChannelUpdate ChannelUpdate_new(LDKSignature signature_arg, LDKUnsignedChannelUpdate contents_arg); +void QueryChannelRange_free(LDKQueryChannelRange this_ptr); + +/** + * The genesis hash of the blockchain being queried + */ +const uint8_t (*QueryChannelRange_get_chain_hash(const LDKQueryChannelRange *this_ptr))[32]; + +/** + * The genesis hash of the blockchain being queried + */ +void QueryChannelRange_set_chain_hash(LDKQueryChannelRange *this_ptr, LDKThirtyTwoBytes val); + +/** + * The height of the first block for the channel UTXOs being queried + */ +uint32_t QueryChannelRange_get_first_blocknum(const LDKQueryChannelRange *this_ptr); + +/** + * The height of the first block for the channel UTXOs being queried + */ +void QueryChannelRange_set_first_blocknum(LDKQueryChannelRange *this_ptr, uint32_t val); + +/** + * The number of blocks to include in the query results + */ +uint32_t QueryChannelRange_get_number_of_blocks(const LDKQueryChannelRange *this_ptr); + +/** + * The number of blocks to include in the query results + */ +void QueryChannelRange_set_number_of_blocks(LDKQueryChannelRange *this_ptr, uint32_t val); + +MUST_USE_RES LDKQueryChannelRange QueryChannelRange_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); + +void ReplyChannelRange_free(LDKReplyChannelRange this_ptr); + +/** + * The genesis hash of the blockchain being queried + */ +const uint8_t (*ReplyChannelRange_get_chain_hash(const LDKReplyChannelRange *this_ptr))[32]; + +/** + * The genesis hash of the blockchain being queried + */ +void ReplyChannelRange_set_chain_hash(LDKReplyChannelRange *this_ptr, LDKThirtyTwoBytes val); + +/** + * The height of the first block in the range of the reply + */ +uint32_t ReplyChannelRange_get_first_blocknum(const LDKReplyChannelRange *this_ptr); + +/** + * The height of the first block in the range of the reply + */ +void ReplyChannelRange_set_first_blocknum(LDKReplyChannelRange *this_ptr, uint32_t val); + +/** + * The number of blocks included in the range of the reply + */ +uint32_t ReplyChannelRange_get_number_of_blocks(const LDKReplyChannelRange *this_ptr); + +/** + * The number of blocks included in the range of the reply + */ +void ReplyChannelRange_set_number_of_blocks(LDKReplyChannelRange *this_ptr, uint32_t val); + +/** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ +bool ReplyChannelRange_get_full_information(const LDKReplyChannelRange *this_ptr); + +/** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ +void ReplyChannelRange_set_full_information(LDKReplyChannelRange *this_ptr, bool val); + +/** + * The short_channel_ids in the channel range + */ +void ReplyChannelRange_set_short_channel_ids(LDKReplyChannelRange *this_ptr, LDKCVec_u64Z val); + +MUST_USE_RES LDKReplyChannelRange ReplyChannelRange_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool full_information_arg, LDKCVec_u64Z short_channel_ids_arg); + +void QueryShortChannelIds_free(LDKQueryShortChannelIds this_ptr); + +/** + * The genesis hash of the blockchain being queried + */ +const uint8_t (*QueryShortChannelIds_get_chain_hash(const LDKQueryShortChannelIds *this_ptr))[32]; + +/** + * The genesis hash of the blockchain being queried + */ +void QueryShortChannelIds_set_chain_hash(LDKQueryShortChannelIds *this_ptr, LDKThirtyTwoBytes val); + +/** + * The short_channel_ids that are being queried + */ +void QueryShortChannelIds_set_short_channel_ids(LDKQueryShortChannelIds *this_ptr, LDKCVec_u64Z val); + +MUST_USE_RES LDKQueryShortChannelIds QueryShortChannelIds_new(LDKThirtyTwoBytes chain_hash_arg, LDKCVec_u64Z short_channel_ids_arg); + +void ReplyShortChannelIdsEnd_free(LDKReplyShortChannelIdsEnd this_ptr); + +/** + * The genesis hash of the blockchain that was queried + */ +const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const LDKReplyShortChannelIdsEnd *this_ptr))[32]; + +/** + * The genesis hash of the blockchain that was queried + */ +void ReplyShortChannelIdsEnd_set_chain_hash(LDKReplyShortChannelIdsEnd *this_ptr, LDKThirtyTwoBytes val); + +/** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ +bool ReplyShortChannelIdsEnd_get_full_information(const LDKReplyShortChannelIdsEnd *this_ptr); + +/** + * Indicates if the query recipient maintains up-to-date channel + * information for the chain_hash + */ +void ReplyShortChannelIdsEnd_set_full_information(LDKReplyShortChannelIdsEnd *this_ptr, bool val); + +MUST_USE_RES LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); + +void GossipTimestampFilter_free(LDKGossipTimestampFilter this_ptr); + +/** + * The genesis hash of the blockchain for channel and node information + */ +const uint8_t (*GossipTimestampFilter_get_chain_hash(const LDKGossipTimestampFilter *this_ptr))[32]; + +/** + * The genesis hash of the blockchain for channel and node information + */ +void GossipTimestampFilter_set_chain_hash(LDKGossipTimestampFilter *this_ptr, LDKThirtyTwoBytes val); + +/** + * The starting unix timestamp + */ +uint32_t GossipTimestampFilter_get_first_timestamp(const LDKGossipTimestampFilter *this_ptr); + +/** + * The starting unix timestamp + */ +void GossipTimestampFilter_set_first_timestamp(LDKGossipTimestampFilter *this_ptr, uint32_t val); + +/** + * The range of information in seconds + */ +uint32_t GossipTimestampFilter_get_timestamp_range(const LDKGossipTimestampFilter *this_ptr); + +/** + * The range of information in seconds + */ +void GossipTimestampFilter_set_timestamp_range(LDKGossipTimestampFilter *this_ptr, uint32_t val); + +MUST_USE_RES LDKGossipTimestampFilter GossipTimestampFilter_new(LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); + void ErrorAction_free(LDKErrorAction this_ptr); void LightningError_free(LDKLightningError this_ptr); @@ -5738,6 +6010,26 @@ LDKCVec_u8Z NodeAnnouncement_write(const LDKNodeAnnouncement *obj); LDKNodeAnnouncement NodeAnnouncement_read(LDKu8slice ser); +LDKQueryShortChannelIds QueryShortChannelIds_read(LDKu8slice ser); + +LDKCVec_u8Z QueryShortChannelIds_write(const LDKQueryShortChannelIds *obj); + +LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_read(LDKu8slice ser); + +LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const LDKReplyShortChannelIdsEnd *obj); + +LDKQueryChannelRange QueryChannelRange_read(LDKu8slice ser); + +LDKCVec_u8Z QueryChannelRange_write(const LDKQueryChannelRange *obj); + +LDKReplyChannelRange ReplyChannelRange_read(LDKu8slice ser); + +LDKCVec_u8Z ReplyChannelRange_write(const LDKReplyChannelRange *obj); + +LDKGossipTimestampFilter GossipTimestampFilter_read(LDKu8slice ser); + +LDKCVec_u8Z GossipTimestampFilter_write(const LDKGossipTimestampFilter *obj); + void MessageHandler_free(LDKMessageHandler this_ptr); /** @@ -5913,76 +6205,88 @@ LDKCResult_PublicKeySecpErrorZ derive_public_key(LDKPublicKey per_commitment_poi /** * Derives a per-commitment-transaction revocation key from its constituent parts. * + * Only the cheating participant owns a valid witness to propagate a revoked + * commitment transaction, thus per_commitment_secret always come from cheater + * and revocation_base_secret always come from punisher, which is the broadcaster + * of the transaction spending with this key knowledge. + * * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*revocation_base_secret)[32]); +LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); /** * Derives a per-commitment-transaction revocation public key from its constituent parts. This is * the public equivalend of derive_private_revocation_key - using only public keys to derive a * public key instead of private keys. * + * Only the cheating participant owns a valid witness to propagate a revoked + * commitment transaction, thus per_commitment_point always come from cheater + * and revocation_base_point always come from punisher, which is the broadcaster + * of the transaction spending with this key knowledge. + * * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ -LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(LDKPublicKey per_commitment_point, LDKPublicKey revocation_base_point); +LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(LDKPublicKey per_commitment_point, LDKPublicKey countersignatory_revocation_base_point); void TxCreationKeys_free(LDKTxCreationKeys this_ptr); /** - * The per-commitment public key which was used to derive the other keys. + * The broadcaster's per-commitment public key which was used to derive the other keys. */ LDKPublicKey TxCreationKeys_get_per_commitment_point(const LDKTxCreationKeys *this_ptr); /** - * The per-commitment public key which was used to derive the other keys. + * The broadcaster's per-commitment public key which was used to derive the other keys. */ void TxCreationKeys_set_per_commitment_point(LDKTxCreationKeys *this_ptr, LDKPublicKey val); /** - * The revocation key which is used to allow the owner of the commitment transaction to - * provide their counterparty the ability to punish them if they broadcast an old state. + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. */ LDKPublicKey TxCreationKeys_get_revocation_key(const LDKTxCreationKeys *this_ptr); /** - * The revocation key which is used to allow the owner of the commitment transaction to - * provide their counterparty the ability to punish them if they broadcast an old state. + * The revocation key which is used to allow the broadcaster of the commitment + * transaction to provide their counterparty the ability to punish them if they broadcast + * an old state. */ void TxCreationKeys_set_revocation_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); /** - * A's HTLC Key + * Broadcaster's HTLC Key */ -LDKPublicKey TxCreationKeys_get_a_htlc_key(const LDKTxCreationKeys *this_ptr); +LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const LDKTxCreationKeys *this_ptr); /** - * A's HTLC Key + * Broadcaster's HTLC Key */ -void TxCreationKeys_set_a_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); +void TxCreationKeys_set_broadcaster_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); /** - * B's HTLC Key + * Countersignatory's HTLC Key */ -LDKPublicKey TxCreationKeys_get_b_htlc_key(const LDKTxCreationKeys *this_ptr); +LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const LDKTxCreationKeys *this_ptr); /** - * B's HTLC Key + * Countersignatory's HTLC Key */ -void TxCreationKeys_set_b_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); +void TxCreationKeys_set_countersignatory_htlc_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); /** - * A's Payment Key (which isn't allowed to be spent from for some delay) + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) */ -LDKPublicKey TxCreationKeys_get_a_delayed_payment_key(const LDKTxCreationKeys *this_ptr); +LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const LDKTxCreationKeys *this_ptr); /** - * A's Payment Key (which isn't allowed to be spent from for some delay) + * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) */ -void TxCreationKeys_set_a_delayed_payment_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); +void TxCreationKeys_set_broadcaster_delayed_payment_key(LDKTxCreationKeys *this_ptr, LDKPublicKey val); -MUST_USE_RES LDKTxCreationKeys TxCreationKeys_new(LDKPublicKey per_commitment_point_arg, LDKPublicKey revocation_key_arg, LDKPublicKey a_htlc_key_arg, LDKPublicKey b_htlc_key_arg, LDKPublicKey a_delayed_payment_key_arg); +MUST_USE_RES LDKTxCreationKeys TxCreationKeys_new(LDKPublicKey per_commitment_point_arg, LDKPublicKey revocation_key_arg, LDKPublicKey broadcaster_htlc_key_arg, LDKPublicKey countersignatory_htlc_key_arg, LDKPublicKey broadcaster_delayed_payment_key_arg); LDKCVec_u8Z TxCreationKeys_write(const LDKTxCreationKeys *obj); @@ -6037,16 +6341,16 @@ LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const LDKChannelPublicKe void ChannelPublicKeys_set_revocation_basepoint(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); /** - * The public key which receives our immediately spendable primary channel balance in - * remote-broadcasted commitment transactions. This key is static across every commitment - * transaction. + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. */ LDKPublicKey ChannelPublicKeys_get_payment_point(const LDKChannelPublicKeys *this_ptr); /** - * The public key which receives our immediately spendable primary channel balance in - * remote-broadcasted commitment transactions. This key is static across every commitment - * transaction. + * The public key on which the non-broadcaster (ie the countersignatory) receives an immediately + * spendable primary channel balance on the broadcaster's commitment transaction. This key is + * static across every commitment transaction. */ void ChannelPublicKeys_set_payment_point(LDKChannelPublicKeys *this_ptr, LDKPublicKey val); @@ -6085,14 +6389,14 @@ LDKChannelPublicKeys ChannelPublicKeys_read(LDKu8slice ser); /** * Create a new TxCreationKeys from channel base points and the per-commitment point */ -MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(LDKPublicKey per_commitment_point, LDKPublicKey a_delayed_payment_base, LDKPublicKey a_htlc_base, LDKPublicKey b_revocation_base, LDKPublicKey b_htlc_base); +MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(LDKPublicKey per_commitment_point, LDKPublicKey broadcaster_delayed_payment_base, LDKPublicKey broadcaster_htlc_base, LDKPublicKey countersignatory_revocation_base, LDKPublicKey countersignatory_htlc_base); /** * A script either spendable by the revocation - * key or the delayed_payment_key and satisfying the relative-locktime OP_CSV constrain. - * Encumbering a `to_local` output on a commitment transaction or 2nd-stage HTLC transactions. + * key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain. + * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions. */ -LDKCVec_u8Z get_revokeable_redeemscript(LDKPublicKey revocation_key, uint16_t to_self_delay, LDKPublicKey delayed_payment_key); +LDKCVec_u8Z get_revokeable_redeemscript(LDKPublicKey revocation_key, uint16_t contest_delay, LDKPublicKey broadcaster_delayed_payment_key); void HTLCOutputInCommitment_free(LDKHTLCOutputInCommitment this_ptr); @@ -6100,7 +6404,7 @@ void HTLCOutputInCommitment_free(LDKHTLCOutputInCommitment this_ptr); * 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 - * the remote party or our own. + * the counterparty or our own. */ bool HTLCOutputInCommitment_get_offered(const LDKHTLCOutputInCommitment *this_ptr); @@ -6108,7 +6412,7 @@ bool HTLCOutputInCommitment_get_offered(const LDKHTLCOutputInCommitment *this_pt * 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 - * the remote party or our own. + * the counterparty or our own. */ void HTLCOutputInCommitment_set_offered(LDKHTLCOutputInCommitment *this_ptr, bool val); @@ -6149,8 +6453,8 @@ LDKCVec_u8Z HTLCOutputInCommitment_write(const LDKHTLCOutputInCommitment *obj); LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(LDKu8slice ser); /** - * note here that 'a_revocation_key' is generated using b_revocation_basepoint and a's - * commitment secret. 'htlc' does *not* need to have its previous_output_index filled. + * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc + * does not need to have its previous_output_index filled. */ LDKCVec_u8Z get_htlc_redeemscript(const LDKHTLCOutputInCommitment *htlc, const LDKTxCreationKeys *keys); @@ -6158,91 +6462,91 @@ LDKCVec_u8Z get_htlc_redeemscript(const LDKHTLCOutputInCommitment *htlc, const L * Gets the redeemscript for a funding output from the two funding public keys. * Note that the order of funding public keys does not matter. */ -LDKCVec_u8Z make_funding_redeemscript(LDKPublicKey a, LDKPublicKey b); +LDKCVec_u8Z make_funding_redeemscript(LDKPublicKey broadcaster, LDKPublicKey countersignatory); /** * panics if htlc.transaction_output_index.is_none()! */ -LDKCVec_u8Z build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t to_self_delay, const LDKHTLCOutputInCommitment *htlc, LDKPublicKey a_delayed_payment_key, LDKPublicKey revocation_key); +LDKCVec_u8Z build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const LDKHTLCOutputInCommitment *htlc, LDKPublicKey broadcaster_delayed_payment_key, LDKPublicKey revocation_key); -void LocalCommitmentTransaction_free(LDKLocalCommitmentTransaction this_ptr); +void HolderCommitmentTransaction_free(LDKHolderCommitmentTransaction this_ptr); /** * The commitment transaction itself, in unsigned form. */ -LDKCVec_u8Z LocalCommitmentTransaction_get_unsigned_tx(const LDKLocalCommitmentTransaction *this_ptr); +LDKCVec_u8Z HolderCommitmentTransaction_get_unsigned_tx(const LDKHolderCommitmentTransaction *this_ptr); /** * The commitment transaction itself, in unsigned form. */ -void LocalCommitmentTransaction_set_unsigned_tx(LDKLocalCommitmentTransaction *this_ptr, LDKCVec_u8Z val); +void HolderCommitmentTransaction_set_unsigned_tx(LDKHolderCommitmentTransaction *this_ptr, LDKCVec_u8Z val); /** * Our counterparty's signature for the transaction, above. */ -LDKSignature LocalCommitmentTransaction_get_their_sig(const LDKLocalCommitmentTransaction *this_ptr); +LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const LDKHolderCommitmentTransaction *this_ptr); /** * Our counterparty's signature for the transaction, above. */ -void LocalCommitmentTransaction_set_their_sig(LDKLocalCommitmentTransaction *this_ptr, LDKSignature val); +void HolderCommitmentTransaction_set_counterparty_sig(LDKHolderCommitmentTransaction *this_ptr, LDKSignature val); /** * The feerate paid per 1000-weight-unit in this commitment transaction. This value is * controlled by the channel initiator. */ -uint32_t LocalCommitmentTransaction_get_feerate_per_kw(const LDKLocalCommitmentTransaction *this_ptr); +uint32_t HolderCommitmentTransaction_get_feerate_per_kw(const LDKHolderCommitmentTransaction *this_ptr); /** * The feerate paid per 1000-weight-unit in this commitment transaction. This value is * controlled by the channel initiator. */ -void LocalCommitmentTransaction_set_feerate_per_kw(LDKLocalCommitmentTransaction *this_ptr, uint32_t val); +void HolderCommitmentTransaction_set_feerate_per_kw(LDKHolderCommitmentTransaction *this_ptr, uint32_t val); /** - * The HTLCs and remote htlc signatures which were included in this commitment transaction. + * The HTLCs and counterparty htlc signatures which were included in this commitment transaction. * * Note that this includes all HTLCs, including ones which were considered dust and not * actually included in the transaction as it appears on-chain, but who's value is burned as - * fees and not included in the to_local or to_remote outputs. + * fees and not included in the to_holder or to_counterparty outputs. * - * The remote HTLC signatures in the second element will always be set for non-dust HTLCs, ie + * The counterparty HTLC signatures in the second element will always be set for non-dust HTLCs, ie * those for which transaction_output_index.is_some(). */ -void LocalCommitmentTransaction_set_per_htlc(LDKLocalCommitmentTransaction *this_ptr, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val); +void HolderCommitmentTransaction_set_per_htlc(LDKHolderCommitmentTransaction *this_ptr, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val); /** - * Generate a new LocalCommitmentTransaction based on a raw commitment transaction, - * remote signature and both parties keys. + * Generate a new HolderCommitmentTransaction based on a raw commitment transaction, + * counterparty signature and both parties keys. * * The unsigned transaction outputs must be consistent with htlc_data. This function * only checks that the shape and amounts are consistent, but does not check the scriptPubkey. */ -MUST_USE_RES LDKLocalCommitmentTransaction LocalCommitmentTransaction_new_missing_local_sig(LDKCVec_u8Z unsigned_tx, LDKSignature their_sig, LDKPublicKey our_funding_key, LDKPublicKey their_funding_key, LDKTxCreationKeys local_keys, uint32_t feerate_per_kw, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data); +MUST_USE_RES LDKHolderCommitmentTransaction HolderCommitmentTransaction_new_missing_holder_sig(LDKCVec_u8Z unsigned_tx, LDKSignature counterparty_sig, LDKPublicKey holder_funding_key, LDKPublicKey counterparty_funding_key, LDKTxCreationKeys keys, uint32_t feerate_per_kw, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data); /** * The pre-calculated transaction creation public keys. * An external validating signer should not trust these keys. */ -MUST_USE_RES LDKTxCreationKeys LocalCommitmentTransaction_trust_key_derivation(const LDKLocalCommitmentTransaction *this_arg); +MUST_USE_RES LDKTxCreationKeys HolderCommitmentTransaction_trust_key_derivation(const LDKHolderCommitmentTransaction *this_arg); /** - * Get the txid of the local commitment transaction contained in this - * LocalCommitmentTransaction + * Get the txid of the holder commitment transaction contained in this + * HolderCommitmentTransaction */ -MUST_USE_RES LDKThirtyTwoBytes LocalCommitmentTransaction_txid(const LDKLocalCommitmentTransaction *this_arg); +MUST_USE_RES LDKThirtyTwoBytes HolderCommitmentTransaction_txid(const LDKHolderCommitmentTransaction *this_arg); /** - * Gets our signature for the contained commitment transaction given our funding private key. + * Gets holder signature for the contained commitment transaction given holder funding private key. * * Funding key is your key included in the 2-2 funding_outpoint lock. Should be provided * by your ChannelKeys. * Funding redeemscript is script locking funding_outpoint. This is the mutlsig script * between your own funding key and your counterparty's. Currently, this is provided in - * ChannelKeys::sign_local_commitment() calls directly. + * ChannelKeys::sign_holder_commitment() calls directly. * Channel value is amount locked in funding_outpoint. */ -MUST_USE_RES LDKSignature LocalCommitmentTransaction_get_local_sig(const LDKLocalCommitmentTransaction *this_arg, const uint8_t (*funding_key)[32], LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); +MUST_USE_RES LDKSignature HolderCommitmentTransaction_get_holder_sig(const LDKHolderCommitmentTransaction *this_arg, const uint8_t (*funding_key)[32], LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); /** * Get a signature for each HTLC which was included in the commitment transaction (ie for @@ -6252,11 +6556,11 @@ MUST_USE_RES LDKSignature LocalCommitmentTransaction_get_local_sig(const LDKLoca * considered dust and not included, a None entry exists, for all others a signature is * included. */ -MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ LocalCommitmentTransaction_get_htlc_sigs(const LDKLocalCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], uint16_t local_csv); +MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ HolderCommitmentTransaction_get_htlc_sigs(const LDKHolderCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], uint16_t counterparty_selected_contest_delay); -LDKCVec_u8Z LocalCommitmentTransaction_write(const LDKLocalCommitmentTransaction *obj); +LDKCVec_u8Z HolderCommitmentTransaction_write(const LDKHolderCommitmentTransaction *obj); -LDKLocalCommitmentTransaction LocalCommitmentTransaction_read(LDKu8slice ser); +LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(LDKu8slice ser); void InitFeatures_free(LDKInitFeatures this_ptr); diff --git a/lightning-c-bindings/include/lightningpp.hpp b/lightning-c-bindings/include/lightningpp.hpp index d494cd40c..d14cd5cc4 100644 --- a/lightning-c-bindings/include/lightningpp.hpp +++ b/lightning-c-bindings/include/lightningpp.hpp @@ -920,6 +920,76 @@ public: const LDKChannelUpdate* operator &() const { return &self; } const LDKChannelUpdate* operator ->() const { return &self; } }; +class QueryChannelRange { +private: + LDKQueryChannelRange self; +public: + QueryChannelRange(const QueryChannelRange&) = delete; + ~QueryChannelRange() { QueryChannelRange_free(self); } + QueryChannelRange(QueryChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(QueryChannelRange)); } + QueryChannelRange(LDKQueryChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryChannelRange)); } + operator LDKQueryChannelRange() { LDKQueryChannelRange res = self; memset(&self, 0, sizeof(LDKQueryChannelRange)); return res; } + LDKQueryChannelRange* operator &() { return &self; } + LDKQueryChannelRange* operator ->() { return &self; } + const LDKQueryChannelRange* operator &() const { return &self; } + const LDKQueryChannelRange* operator ->() const { return &self; } +}; +class ReplyChannelRange { +private: + LDKReplyChannelRange self; +public: + ReplyChannelRange(const ReplyChannelRange&) = delete; + ~ReplyChannelRange() { ReplyChannelRange_free(self); } + ReplyChannelRange(ReplyChannelRange&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyChannelRange)); } + ReplyChannelRange(LDKReplyChannelRange&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyChannelRange)); } + operator LDKReplyChannelRange() { LDKReplyChannelRange res = self; memset(&self, 0, sizeof(LDKReplyChannelRange)); return res; } + LDKReplyChannelRange* operator &() { return &self; } + LDKReplyChannelRange* operator ->() { return &self; } + const LDKReplyChannelRange* operator &() const { return &self; } + const LDKReplyChannelRange* operator ->() const { return &self; } +}; +class QueryShortChannelIds { +private: + LDKQueryShortChannelIds self; +public: + QueryShortChannelIds(const QueryShortChannelIds&) = delete; + ~QueryShortChannelIds() { QueryShortChannelIds_free(self); } + QueryShortChannelIds(QueryShortChannelIds&& o) : self(o.self) { memset(&o, 0, sizeof(QueryShortChannelIds)); } + QueryShortChannelIds(LDKQueryShortChannelIds&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKQueryShortChannelIds)); } + operator LDKQueryShortChannelIds() { LDKQueryShortChannelIds res = self; memset(&self, 0, sizeof(LDKQueryShortChannelIds)); return res; } + LDKQueryShortChannelIds* operator &() { return &self; } + LDKQueryShortChannelIds* operator ->() { return &self; } + const LDKQueryShortChannelIds* operator &() const { return &self; } + const LDKQueryShortChannelIds* operator ->() const { return &self; } +}; +class ReplyShortChannelIdsEnd { +private: + LDKReplyShortChannelIdsEnd self; +public: + ReplyShortChannelIdsEnd(const ReplyShortChannelIdsEnd&) = delete; + ~ReplyShortChannelIdsEnd() { ReplyShortChannelIdsEnd_free(self); } + ReplyShortChannelIdsEnd(ReplyShortChannelIdsEnd&& o) : self(o.self) { memset(&o, 0, sizeof(ReplyShortChannelIdsEnd)); } + ReplyShortChannelIdsEnd(LDKReplyShortChannelIdsEnd&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKReplyShortChannelIdsEnd)); } + operator LDKReplyShortChannelIdsEnd() { LDKReplyShortChannelIdsEnd res = self; memset(&self, 0, sizeof(LDKReplyShortChannelIdsEnd)); return res; } + LDKReplyShortChannelIdsEnd* operator &() { return &self; } + LDKReplyShortChannelIdsEnd* operator ->() { return &self; } + const LDKReplyShortChannelIdsEnd* operator &() const { return &self; } + const LDKReplyShortChannelIdsEnd* operator ->() const { return &self; } +}; +class GossipTimestampFilter { +private: + LDKGossipTimestampFilter self; +public: + GossipTimestampFilter(const GossipTimestampFilter&) = delete; + ~GossipTimestampFilter() { GossipTimestampFilter_free(self); } + GossipTimestampFilter(GossipTimestampFilter&& o) : self(o.self) { memset(&o, 0, sizeof(GossipTimestampFilter)); } + GossipTimestampFilter(LDKGossipTimestampFilter&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKGossipTimestampFilter)); } + operator LDKGossipTimestampFilter() { LDKGossipTimestampFilter res = self; memset(&self, 0, sizeof(LDKGossipTimestampFilter)); return res; } + LDKGossipTimestampFilter* operator &() { return &self; } + LDKGossipTimestampFilter* operator ->() { return &self; } + const LDKGossipTimestampFilter* operator &() const { return &self; } + const LDKGossipTimestampFilter* operator ->() const { return &self; } +}; class ErrorAction { private: LDKErrorAction self; @@ -1116,19 +1186,19 @@ public: const LDKHTLCOutputInCommitment* operator &() const { return &self; } const LDKHTLCOutputInCommitment* operator ->() const { return &self; } }; -class LocalCommitmentTransaction { +class HolderCommitmentTransaction { private: - LDKLocalCommitmentTransaction self; + LDKHolderCommitmentTransaction self; public: - LocalCommitmentTransaction(const LocalCommitmentTransaction&) = delete; - ~LocalCommitmentTransaction() { LocalCommitmentTransaction_free(self); } - LocalCommitmentTransaction(LocalCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(LocalCommitmentTransaction)); } - LocalCommitmentTransaction(LDKLocalCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKLocalCommitmentTransaction)); } - operator LDKLocalCommitmentTransaction() { LDKLocalCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKLocalCommitmentTransaction)); return res; } - LDKLocalCommitmentTransaction* operator &() { return &self; } - LDKLocalCommitmentTransaction* operator ->() { return &self; } - const LDKLocalCommitmentTransaction* operator &() const { return &self; } - const LDKLocalCommitmentTransaction* operator ->() const { return &self; } + HolderCommitmentTransaction(const HolderCommitmentTransaction&) = delete; + ~HolderCommitmentTransaction() { HolderCommitmentTransaction_free(self); } + HolderCommitmentTransaction(HolderCommitmentTransaction&& o) : self(o.self) { memset(&o, 0, sizeof(HolderCommitmentTransaction)); } + HolderCommitmentTransaction(LDKHolderCommitmentTransaction&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKHolderCommitmentTransaction)); } + operator LDKHolderCommitmentTransaction() { LDKHolderCommitmentTransaction res = self; memset(&self, 0, sizeof(LDKHolderCommitmentTransaction)); return res; } + LDKHolderCommitmentTransaction* operator &() { return &self; } + LDKHolderCommitmentTransaction* operator ->() { return &self; } + const LDKHolderCommitmentTransaction* operator &() const { return &self; } + const LDKHolderCommitmentTransaction* operator ->() const { return &self; } }; class InitFeatures { private: @@ -1326,61 +1396,33 @@ public: const LDKNodeInfo* operator &() const { return &self; } const LDKNodeInfo* operator ->() const { return &self; } }; -class CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ { -private: - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ self; -public: - CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(const CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&) = delete; - ~CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ() { CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(self); } - CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); } - CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); } - operator LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ() { LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); return res; } - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator &() { return &self; } - LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator ->() { return &self; } - const LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator &() const { return &self; } - const LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator ->() const { return &self; } -}; -class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { -private: - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ self; -public: - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(const CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&) = delete; - ~CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); } - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } - CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } - operator LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = self; memset(&self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return res; } - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() { return &self; } - LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() { return &self; } - const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() const { return &self; } - const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() const { return &self; } -}; -class CVec_CVec_RouteHopZZ { +class CResult_PublicKeySecpErrorZ { private: - LDKCVec_CVec_RouteHopZZ self; + LDKCResult_PublicKeySecpErrorZ self; public: - CVec_CVec_RouteHopZZ(const CVec_CVec_RouteHopZZ&) = delete; - ~CVec_CVec_RouteHopZZ() { CVec_CVec_RouteHopZZ_free(self); } - CVec_CVec_RouteHopZZ(CVec_CVec_RouteHopZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_CVec_RouteHopZZ)); } - CVec_CVec_RouteHopZZ(LDKCVec_CVec_RouteHopZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_CVec_RouteHopZZ)); } - operator LDKCVec_CVec_RouteHopZZ() { LDKCVec_CVec_RouteHopZZ res = self; memset(&self, 0, sizeof(LDKCVec_CVec_RouteHopZZ)); return res; } - LDKCVec_CVec_RouteHopZZ* operator &() { return &self; } - LDKCVec_CVec_RouteHopZZ* operator ->() { return &self; } - const LDKCVec_CVec_RouteHopZZ* operator &() const { return &self; } - const LDKCVec_CVec_RouteHopZZ* operator ->() const { return &self; } + CResult_PublicKeySecpErrorZ(const CResult_PublicKeySecpErrorZ&) = delete; + ~CResult_PublicKeySecpErrorZ() { CResult_PublicKeySecpErrorZ_free(self); } + CResult_PublicKeySecpErrorZ(CResult_PublicKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); } + CResult_PublicKeySecpErrorZ(LDKCResult_PublicKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); } + operator LDKCResult_PublicKeySecpErrorZ() { LDKCResult_PublicKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); return res; } + LDKCResult_PublicKeySecpErrorZ* operator &() { return &self; } + LDKCResult_PublicKeySecpErrorZ* operator ->() { return &self; } + const LDKCResult_PublicKeySecpErrorZ* operator &() const { return &self; } + const LDKCResult_PublicKeySecpErrorZ* operator ->() const { return &self; } }; -class CVec_HTLCOutputInCommitmentZ { +class CVec_u8Z { private: - LDKCVec_HTLCOutputInCommitmentZ self; + LDKCVec_u8Z self; public: - CVec_HTLCOutputInCommitmentZ(const CVec_HTLCOutputInCommitmentZ&) = delete; - ~CVec_HTLCOutputInCommitmentZ() { CVec_HTLCOutputInCommitmentZ_free(self); } - CVec_HTLCOutputInCommitmentZ(CVec_HTLCOutputInCommitmentZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_HTLCOutputInCommitmentZ)); } - CVec_HTLCOutputInCommitmentZ(LDKCVec_HTLCOutputInCommitmentZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_HTLCOutputInCommitmentZ)); } - operator LDKCVec_HTLCOutputInCommitmentZ() { LDKCVec_HTLCOutputInCommitmentZ res = self; memset(&self, 0, sizeof(LDKCVec_HTLCOutputInCommitmentZ)); return res; } - LDKCVec_HTLCOutputInCommitmentZ* operator &() { return &self; } - LDKCVec_HTLCOutputInCommitmentZ* operator ->() { return &self; } - const LDKCVec_HTLCOutputInCommitmentZ* operator &() const { return &self; } - const LDKCVec_HTLCOutputInCommitmentZ* operator ->() const { return &self; } + CVec_u8Z(const CVec_u8Z&) = delete; + ~CVec_u8Z() { CVec_u8Z_free(self); } + CVec_u8Z(CVec_u8Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u8Z)); } + CVec_u8Z(LDKCVec_u8Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u8Z)); } + operator LDKCVec_u8Z() { LDKCVec_u8Z res = self; memset(&self, 0, sizeof(LDKCVec_u8Z)); return res; } + LDKCVec_u8Z* operator &() { return &self; } + LDKCVec_u8Z* operator ->() { return &self; } + const LDKCVec_u8Z* operator &() const { return &self; } + const LDKCVec_u8Z* operator ->() const { return &self; } }; class CResult_NoneMonitorUpdateErrorZ { private: @@ -1396,89 +1438,75 @@ public: const LDKCResult_NoneMonitorUpdateErrorZ* operator &() const { return &self; } const LDKCResult_NoneMonitorUpdateErrorZ* operator ->() const { return &self; } }; -class C2Tuple_Txidu32Z { -private: - LDKC2Tuple_Txidu32Z self; -public: - C2Tuple_Txidu32Z(const C2Tuple_Txidu32Z&) = delete; - ~C2Tuple_Txidu32Z() { C2Tuple_Txidu32Z_free(self); } - C2Tuple_Txidu32Z(C2Tuple_Txidu32Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_Txidu32Z)); } - C2Tuple_Txidu32Z(LDKC2Tuple_Txidu32Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_Txidu32Z)); } - operator LDKC2Tuple_Txidu32Z() { LDKC2Tuple_Txidu32Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_Txidu32Z)); return res; } - LDKC2Tuple_Txidu32Z* operator &() { return &self; } - LDKC2Tuple_Txidu32Z* operator ->() { return &self; } - const LDKC2Tuple_Txidu32Z* operator &() const { return &self; } - const LDKC2Tuple_Txidu32Z* operator ->() const { return &self; } -}; -class CResult_SignatureNoneZ { +class C2Tuple_OutPointScriptZ { private: - LDKCResult_SignatureNoneZ self; + LDKC2Tuple_OutPointScriptZ self; public: - CResult_SignatureNoneZ(const CResult_SignatureNoneZ&) = delete; - ~CResult_SignatureNoneZ() { CResult_SignatureNoneZ_free(self); } - CResult_SignatureNoneZ(CResult_SignatureNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SignatureNoneZ)); } - CResult_SignatureNoneZ(LDKCResult_SignatureNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SignatureNoneZ)); } - operator LDKCResult_SignatureNoneZ() { LDKCResult_SignatureNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_SignatureNoneZ)); return res; } - LDKCResult_SignatureNoneZ* operator &() { return &self; } - LDKCResult_SignatureNoneZ* operator ->() { return &self; } - const LDKCResult_SignatureNoneZ* operator &() const { return &self; } - const LDKCResult_SignatureNoneZ* operator ->() const { return &self; } + C2Tuple_OutPointScriptZ(const C2Tuple_OutPointScriptZ&) = delete; + ~C2Tuple_OutPointScriptZ() { C2Tuple_OutPointScriptZ_free(self); } + C2Tuple_OutPointScriptZ(C2Tuple_OutPointScriptZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_OutPointScriptZ)); } + C2Tuple_OutPointScriptZ(LDKC2Tuple_OutPointScriptZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_OutPointScriptZ)); } + operator LDKC2Tuple_OutPointScriptZ() { LDKC2Tuple_OutPointScriptZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_OutPointScriptZ)); return res; } + LDKC2Tuple_OutPointScriptZ* operator &() { return &self; } + LDKC2Tuple_OutPointScriptZ* operator ->() { return &self; } + const LDKC2Tuple_OutPointScriptZ* operator &() const { return &self; } + const LDKC2Tuple_OutPointScriptZ* operator ->() const { return &self; } }; -class CVec_UpdateFailMalformedHTLCZ { +class CVec_u64Z { private: - LDKCVec_UpdateFailMalformedHTLCZ self; + LDKCVec_u64Z self; public: - CVec_UpdateFailMalformedHTLCZ(const CVec_UpdateFailMalformedHTLCZ&) = delete; - ~CVec_UpdateFailMalformedHTLCZ() { CVec_UpdateFailMalformedHTLCZ_free(self); } - CVec_UpdateFailMalformedHTLCZ(CVec_UpdateFailMalformedHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailMalformedHTLCZ)); } - CVec_UpdateFailMalformedHTLCZ(LDKCVec_UpdateFailMalformedHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailMalformedHTLCZ)); } - operator LDKCVec_UpdateFailMalformedHTLCZ() { LDKCVec_UpdateFailMalformedHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailMalformedHTLCZ)); return res; } - LDKCVec_UpdateFailMalformedHTLCZ* operator &() { return &self; } - LDKCVec_UpdateFailMalformedHTLCZ* operator ->() { return &self; } - const LDKCVec_UpdateFailMalformedHTLCZ* operator &() const { return &self; } - const LDKCVec_UpdateFailMalformedHTLCZ* operator ->() const { return &self; } + CVec_u64Z(const CVec_u64Z&) = delete; + ~CVec_u64Z() { CVec_u64Z_free(self); } + CVec_u64Z(CVec_u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u64Z)); } + CVec_u64Z(LDKCVec_u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u64Z)); } + operator LDKCVec_u64Z() { LDKCVec_u64Z res = self; memset(&self, 0, sizeof(LDKCVec_u64Z)); return res; } + LDKCVec_u64Z* operator &() { return &self; } + LDKCVec_u64Z* operator ->() { return &self; } + const LDKCVec_u64Z* operator &() const { return &self; } + const LDKCVec_u64Z* operator ->() const { return &self; } }; -class CResult_NoneAPIErrorZ { +class CVec_CVec_RouteHopZZ { private: - LDKCResult_NoneAPIErrorZ self; + LDKCVec_CVec_RouteHopZZ self; public: - CResult_NoneAPIErrorZ(const CResult_NoneAPIErrorZ&) = delete; - ~CResult_NoneAPIErrorZ() { CResult_NoneAPIErrorZ_free(self); } - CResult_NoneAPIErrorZ(CResult_NoneAPIErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NoneAPIErrorZ)); } - CResult_NoneAPIErrorZ(LDKCResult_NoneAPIErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NoneAPIErrorZ)); } - operator LDKCResult_NoneAPIErrorZ() { LDKCResult_NoneAPIErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NoneAPIErrorZ)); return res; } - LDKCResult_NoneAPIErrorZ* operator &() { return &self; } - LDKCResult_NoneAPIErrorZ* operator ->() { return &self; } - const LDKCResult_NoneAPIErrorZ* operator &() const { return &self; } - const LDKCResult_NoneAPIErrorZ* operator ->() const { return &self; } + CVec_CVec_RouteHopZZ(const CVec_CVec_RouteHopZZ&) = delete; + ~CVec_CVec_RouteHopZZ() { CVec_CVec_RouteHopZZ_free(self); } + CVec_CVec_RouteHopZZ(CVec_CVec_RouteHopZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_CVec_RouteHopZZ)); } + CVec_CVec_RouteHopZZ(LDKCVec_CVec_RouteHopZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_CVec_RouteHopZZ)); } + operator LDKCVec_CVec_RouteHopZZ() { LDKCVec_CVec_RouteHopZZ res = self; memset(&self, 0, sizeof(LDKCVec_CVec_RouteHopZZ)); return res; } + LDKCVec_CVec_RouteHopZZ* operator &() { return &self; } + LDKCVec_CVec_RouteHopZZ* operator ->() { return &self; } + const LDKCVec_CVec_RouteHopZZ* operator &() const { return &self; } + const LDKCVec_CVec_RouteHopZZ* operator ->() const { return &self; } }; -class CVec_SpendableOutputDescriptorZ { +class CVec_TransactionZ { private: - LDKCVec_SpendableOutputDescriptorZ self; + LDKCVec_TransactionZ self; public: - CVec_SpendableOutputDescriptorZ(const CVec_SpendableOutputDescriptorZ&) = delete; - ~CVec_SpendableOutputDescriptorZ() { CVec_SpendableOutputDescriptorZ_free(self); } - CVec_SpendableOutputDescriptorZ(CVec_SpendableOutputDescriptorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SpendableOutputDescriptorZ)); } - CVec_SpendableOutputDescriptorZ(LDKCVec_SpendableOutputDescriptorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SpendableOutputDescriptorZ)); } - operator LDKCVec_SpendableOutputDescriptorZ() { LDKCVec_SpendableOutputDescriptorZ res = self; memset(&self, 0, sizeof(LDKCVec_SpendableOutputDescriptorZ)); return res; } - LDKCVec_SpendableOutputDescriptorZ* operator &() { return &self; } - LDKCVec_SpendableOutputDescriptorZ* operator ->() { return &self; } - const LDKCVec_SpendableOutputDescriptorZ* operator &() const { return &self; } - const LDKCVec_SpendableOutputDescriptorZ* operator ->() const { return &self; } + 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 C2Tuple_SignatureCVec_SignatureZZ { +class CResult_C2Tuple_Scriptu64ZChainErrorZ { private: - LDKC2Tuple_SignatureCVec_SignatureZZ self; + LDKCResult_C2Tuple_Scriptu64ZChainErrorZ self; public: - C2Tuple_SignatureCVec_SignatureZZ(const C2Tuple_SignatureCVec_SignatureZZ&) = delete; - ~C2Tuple_SignatureCVec_SignatureZZ() { C2Tuple_SignatureCVec_SignatureZZ_free(self); } - C2Tuple_SignatureCVec_SignatureZZ(C2Tuple_SignatureCVec_SignatureZZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_SignatureCVec_SignatureZZ)); } - C2Tuple_SignatureCVec_SignatureZZ(LDKC2Tuple_SignatureCVec_SignatureZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ)); } - operator LDKC2Tuple_SignatureCVec_SignatureZZ() { LDKC2Tuple_SignatureCVec_SignatureZZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ)); return res; } - LDKC2Tuple_SignatureCVec_SignatureZZ* operator &() { return &self; } - LDKC2Tuple_SignatureCVec_SignatureZZ* operator ->() { return &self; } - const LDKC2Tuple_SignatureCVec_SignatureZZ* operator &() const { return &self; } - const LDKC2Tuple_SignatureCVec_SignatureZZ* operator ->() const { return &self; } + CResult_C2Tuple_Scriptu64ZChainErrorZ(const CResult_C2Tuple_Scriptu64ZChainErrorZ&) = delete; + ~CResult_C2Tuple_Scriptu64ZChainErrorZ() { CResult_C2Tuple_Scriptu64ZChainErrorZ_free(self); } + CResult_C2Tuple_Scriptu64ZChainErrorZ(CResult_C2Tuple_Scriptu64ZChainErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_Scriptu64ZChainErrorZ)); } + CResult_C2Tuple_Scriptu64ZChainErrorZ(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ)); } + operator LDKCResult_C2Tuple_Scriptu64ZChainErrorZ() { LDKCResult_C2Tuple_Scriptu64ZChainErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ)); return res; } + LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator &() { return &self; } + LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator ->() { return &self; } + const LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator &() const { return &self; } + const LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator ->() const { return &self; } }; class CResult_CVec_SignatureZNoneZ { private: @@ -1494,159 +1522,159 @@ public: const LDKCResult_CVec_SignatureZNoneZ* operator &() const { return &self; } const LDKCResult_CVec_SignatureZNoneZ* operator ->() const { return &self; } }; -class CResult_CVec_u8ZPeerHandleErrorZ { +class CVec_NodeAnnouncementZ { private: - LDKCResult_CVec_u8ZPeerHandleErrorZ self; + LDKCVec_NodeAnnouncementZ self; public: - CResult_CVec_u8ZPeerHandleErrorZ(const CResult_CVec_u8ZPeerHandleErrorZ&) = delete; - ~CResult_CVec_u8ZPeerHandleErrorZ() { CResult_CVec_u8ZPeerHandleErrorZ_free(self); } - CResult_CVec_u8ZPeerHandleErrorZ(CResult_CVec_u8ZPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); } - CResult_CVec_u8ZPeerHandleErrorZ(LDKCResult_CVec_u8ZPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); } - operator LDKCResult_CVec_u8ZPeerHandleErrorZ() { LDKCResult_CVec_u8ZPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); return res; } - LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() { return &self; } - LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() { return &self; } - const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() const { return &self; } - const LDKCResult_CVec_u8ZPeerHandleErrorZ* 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 CResult_TxCreationKeysSecpErrorZ { +class CResult_RouteLightningErrorZ { private: - LDKCResult_TxCreationKeysSecpErrorZ self; + LDKCResult_RouteLightningErrorZ self; public: - CResult_TxCreationKeysSecpErrorZ(const CResult_TxCreationKeysSecpErrorZ&) = delete; - ~CResult_TxCreationKeysSecpErrorZ() { CResult_TxCreationKeysSecpErrorZ_free(self); } - CResult_TxCreationKeysSecpErrorZ(CResult_TxCreationKeysSecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); } - CResult_TxCreationKeysSecpErrorZ(LDKCResult_TxCreationKeysSecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); } - operator LDKCResult_TxCreationKeysSecpErrorZ() { LDKCResult_TxCreationKeysSecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); return res; } - LDKCResult_TxCreationKeysSecpErrorZ* operator &() { return &self; } - LDKCResult_TxCreationKeysSecpErrorZ* operator ->() { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator &() const { return &self; } - const LDKCResult_TxCreationKeysSecpErrorZ* operator ->() const { return &self; } + CResult_RouteLightningErrorZ(const CResult_RouteLightningErrorZ&) = delete; + ~CResult_RouteLightningErrorZ() { CResult_RouteLightningErrorZ_free(self); } + CResult_RouteLightningErrorZ(CResult_RouteLightningErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); } + CResult_RouteLightningErrorZ(LDKCResult_RouteLightningErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); } + operator LDKCResult_RouteLightningErrorZ() { LDKCResult_RouteLightningErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); return res; } + LDKCResult_RouteLightningErrorZ* operator &() { return &self; } + LDKCResult_RouteLightningErrorZ* operator ->() { return &self; } + const LDKCResult_RouteLightningErrorZ* operator &() const { return &self; } + const LDKCResult_RouteLightningErrorZ* operator ->() const { return &self; } }; -class CVec_RouteHopZ { +class CResult_boolPeerHandleErrorZ { private: - LDKCVec_RouteHopZ self; + LDKCResult_boolPeerHandleErrorZ self; public: - CVec_RouteHopZ(const CVec_RouteHopZ&) = delete; - ~CVec_RouteHopZ() { CVec_RouteHopZ_free(self); } - CVec_RouteHopZ(CVec_RouteHopZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_RouteHopZ)); } - CVec_RouteHopZ(LDKCVec_RouteHopZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_RouteHopZ)); } - operator LDKCVec_RouteHopZ() { LDKCVec_RouteHopZ res = self; memset(&self, 0, sizeof(LDKCVec_RouteHopZ)); return res; } - LDKCVec_RouteHopZ* operator &() { return &self; } - LDKCVec_RouteHopZ* operator ->() { return &self; } - const LDKCVec_RouteHopZ* operator &() const { return &self; } - const LDKCVec_RouteHopZ* operator ->() const { return &self; } -}; -class CVec_RouteHintZ { + CResult_boolPeerHandleErrorZ(const CResult_boolPeerHandleErrorZ&) = delete; + ~CResult_boolPeerHandleErrorZ() { CResult_boolPeerHandleErrorZ_free(self); } + CResult_boolPeerHandleErrorZ(CResult_boolPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_boolPeerHandleErrorZ)); } + CResult_boolPeerHandleErrorZ(LDKCResult_boolPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_boolPeerHandleErrorZ)); } + operator LDKCResult_boolPeerHandleErrorZ() { LDKCResult_boolPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_boolPeerHandleErrorZ)); return res; } + LDKCResult_boolPeerHandleErrorZ* operator &() { return &self; } + LDKCResult_boolPeerHandleErrorZ* operator ->() { return &self; } + const LDKCResult_boolPeerHandleErrorZ* operator &() const { return &self; } + const LDKCResult_boolPeerHandleErrorZ* operator ->() const { return &self; } +}; +class C2Tuple_SignatureCVec_SignatureZZ { private: - LDKCVec_RouteHintZ self; + LDKC2Tuple_SignatureCVec_SignatureZZ self; public: - CVec_RouteHintZ(const CVec_RouteHintZ&) = delete; - ~CVec_RouteHintZ() { CVec_RouteHintZ_free(self); } - CVec_RouteHintZ(CVec_RouteHintZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_RouteHintZ)); } - CVec_RouteHintZ(LDKCVec_RouteHintZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_RouteHintZ)); } - operator LDKCVec_RouteHintZ() { LDKCVec_RouteHintZ res = self; memset(&self, 0, sizeof(LDKCVec_RouteHintZ)); return res; } - LDKCVec_RouteHintZ* operator &() { return &self; } - LDKCVec_RouteHintZ* operator ->() { return &self; } - const LDKCVec_RouteHintZ* operator &() const { return &self; } - const LDKCVec_RouteHintZ* operator ->() const { return &self; } + C2Tuple_SignatureCVec_SignatureZZ(const C2Tuple_SignatureCVec_SignatureZZ&) = delete; + ~C2Tuple_SignatureCVec_SignatureZZ() { C2Tuple_SignatureCVec_SignatureZZ_free(self); } + C2Tuple_SignatureCVec_SignatureZZ(C2Tuple_SignatureCVec_SignatureZZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_SignatureCVec_SignatureZZ)); } + C2Tuple_SignatureCVec_SignatureZZ(LDKC2Tuple_SignatureCVec_SignatureZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ)); } + operator LDKC2Tuple_SignatureCVec_SignatureZZ() { LDKC2Tuple_SignatureCVec_SignatureZZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ)); return res; } + LDKC2Tuple_SignatureCVec_SignatureZZ* operator &() { return &self; } + LDKC2Tuple_SignatureCVec_SignatureZZ* operator ->() { return &self; } + const LDKC2Tuple_SignatureCVec_SignatureZZ* operator &() const { return &self; } + const LDKC2Tuple_SignatureCVec_SignatureZZ* operator ->() const { return &self; } }; -class CResult_RouteLightningErrorZ { +class CVec_HTLCOutputInCommitmentZ { private: - LDKCResult_RouteLightningErrorZ self; + LDKCVec_HTLCOutputInCommitmentZ self; public: - CResult_RouteLightningErrorZ(const CResult_RouteLightningErrorZ&) = delete; - ~CResult_RouteLightningErrorZ() { CResult_RouteLightningErrorZ_free(self); } - CResult_RouteLightningErrorZ(CResult_RouteLightningErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_RouteLightningErrorZ)); } - CResult_RouteLightningErrorZ(LDKCResult_RouteLightningErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); } - operator LDKCResult_RouteLightningErrorZ() { LDKCResult_RouteLightningErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_RouteLightningErrorZ)); return res; } - LDKCResult_RouteLightningErrorZ* operator &() { return &self; } - LDKCResult_RouteLightningErrorZ* operator ->() { return &self; } - const LDKCResult_RouteLightningErrorZ* operator &() const { return &self; } - const LDKCResult_RouteLightningErrorZ* operator ->() const { return &self; } + CVec_HTLCOutputInCommitmentZ(const CVec_HTLCOutputInCommitmentZ&) = delete; + ~CVec_HTLCOutputInCommitmentZ() { CVec_HTLCOutputInCommitmentZ_free(self); } + CVec_HTLCOutputInCommitmentZ(CVec_HTLCOutputInCommitmentZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_HTLCOutputInCommitmentZ)); } + CVec_HTLCOutputInCommitmentZ(LDKCVec_HTLCOutputInCommitmentZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_HTLCOutputInCommitmentZ)); } + operator LDKCVec_HTLCOutputInCommitmentZ() { LDKCVec_HTLCOutputInCommitmentZ res = self; memset(&self, 0, sizeof(LDKCVec_HTLCOutputInCommitmentZ)); return res; } + LDKCVec_HTLCOutputInCommitmentZ* operator &() { return &self; } + LDKCVec_HTLCOutputInCommitmentZ* operator ->() { return &self; } + const LDKCVec_HTLCOutputInCommitmentZ* operator &() const { return &self; } + const LDKCVec_HTLCOutputInCommitmentZ* operator ->() const { return &self; } }; -class C2Tuple_u64u64Z { +class C2Tuple_Scriptu64Z { private: - LDKC2Tuple_u64u64Z self; + LDKC2Tuple_Scriptu64Z self; public: - C2Tuple_u64u64Z(const C2Tuple_u64u64Z&) = delete; - ~C2Tuple_u64u64Z() { C2Tuple_u64u64Z_free(self); } - C2Tuple_u64u64Z(C2Tuple_u64u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_u64u64Z)); } - C2Tuple_u64u64Z(LDKC2Tuple_u64u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_u64u64Z)); } - operator LDKC2Tuple_u64u64Z() { LDKC2Tuple_u64u64Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_u64u64Z)); return res; } - LDKC2Tuple_u64u64Z* operator &() { return &self; } - LDKC2Tuple_u64u64Z* operator ->() { return &self; } - const LDKC2Tuple_u64u64Z* operator &() const { return &self; } - const LDKC2Tuple_u64u64Z* operator ->() const { return &self; } + C2Tuple_Scriptu64Z(const C2Tuple_Scriptu64Z&) = delete; + ~C2Tuple_Scriptu64Z() { C2Tuple_Scriptu64Z_free(self); } + C2Tuple_Scriptu64Z(C2Tuple_Scriptu64Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_Scriptu64Z)); } + C2Tuple_Scriptu64Z(LDKC2Tuple_Scriptu64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_Scriptu64Z)); } + operator LDKC2Tuple_Scriptu64Z() { LDKC2Tuple_Scriptu64Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_Scriptu64Z)); return res; } + LDKC2Tuple_Scriptu64Z* operator &() { return &self; } + LDKC2Tuple_Scriptu64Z* operator ->() { return &self; } + const LDKC2Tuple_Scriptu64Z* operator &() const { return &self; } + const LDKC2Tuple_Scriptu64Z* operator ->() const { return &self; } }; -class CVec_MessageSendEventZ { +class CVec_ChannelMonitorZ { private: - LDKCVec_MessageSendEventZ self; + LDKCVec_ChannelMonitorZ self; public: - CVec_MessageSendEventZ(const CVec_MessageSendEventZ&) = delete; - ~CVec_MessageSendEventZ() { CVec_MessageSendEventZ_free(self); } - CVec_MessageSendEventZ(CVec_MessageSendEventZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_MessageSendEventZ)); } - CVec_MessageSendEventZ(LDKCVec_MessageSendEventZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_MessageSendEventZ)); } - operator LDKCVec_MessageSendEventZ() { LDKCVec_MessageSendEventZ res = self; memset(&self, 0, sizeof(LDKCVec_MessageSendEventZ)); return res; } - LDKCVec_MessageSendEventZ* operator &() { return &self; } - LDKCVec_MessageSendEventZ* operator ->() { return &self; } - const LDKCVec_MessageSendEventZ* operator &() const { return &self; } - const LDKCVec_MessageSendEventZ* operator ->() const { return &self; } + CVec_ChannelMonitorZ(const CVec_ChannelMonitorZ&) = delete; + ~CVec_ChannelMonitorZ() { CVec_ChannelMonitorZ_free(self); } + CVec_ChannelMonitorZ(CVec_ChannelMonitorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_ChannelMonitorZ)); } + CVec_ChannelMonitorZ(LDKCVec_ChannelMonitorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_ChannelMonitorZ)); } + operator LDKCVec_ChannelMonitorZ() { LDKCVec_ChannelMonitorZ res = self; memset(&self, 0, sizeof(LDKCVec_ChannelMonitorZ)); return res; } + LDKCVec_ChannelMonitorZ* operator &() { return &self; } + LDKCVec_ChannelMonitorZ* operator ->() { return &self; } + const LDKCVec_ChannelMonitorZ* operator &() const { return &self; } + const LDKCVec_ChannelMonitorZ* operator ->() const { return &self; } }; -class C2Tuple_HTLCOutputInCommitmentSignatureZ { +class C2Tuple_Txidu32Z { private: - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ self; + LDKC2Tuple_Txidu32Z self; public: - C2Tuple_HTLCOutputInCommitmentSignatureZ(const C2Tuple_HTLCOutputInCommitmentSignatureZ&) = delete; - ~C2Tuple_HTLCOutputInCommitmentSignatureZ() { C2Tuple_HTLCOutputInCommitmentSignatureZ_free(self); } - C2Tuple_HTLCOutputInCommitmentSignatureZ(C2Tuple_HTLCOutputInCommitmentSignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_HTLCOutputInCommitmentSignatureZ)); } - C2Tuple_HTLCOutputInCommitmentSignatureZ(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ)); } - operator LDKC2Tuple_HTLCOutputInCommitmentSignatureZ() { LDKC2Tuple_HTLCOutputInCommitmentSignatureZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ)); return res; } - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator &() { return &self; } - LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator ->() { return &self; } - const LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator &() const { return &self; } - const LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator ->() const { return &self; } + C2Tuple_Txidu32Z(const C2Tuple_Txidu32Z&) = delete; + ~C2Tuple_Txidu32Z() { C2Tuple_Txidu32Z_free(self); } + C2Tuple_Txidu32Z(C2Tuple_Txidu32Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_Txidu32Z)); } + C2Tuple_Txidu32Z(LDKC2Tuple_Txidu32Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_Txidu32Z)); } + operator LDKC2Tuple_Txidu32Z() { LDKC2Tuple_Txidu32Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_Txidu32Z)); return res; } + LDKC2Tuple_Txidu32Z* operator &() { return &self; } + LDKC2Tuple_Txidu32Z* operator ->() { return &self; } + const LDKC2Tuple_Txidu32Z* operator &() const { return &self; } + const LDKC2Tuple_Txidu32Z* operator ->() const { return &self; } }; -class CVec_SignatureZ { +class CVec_ChannelDetailsZ { private: - LDKCVec_SignatureZ self; + LDKCVec_ChannelDetailsZ self; public: - CVec_SignatureZ(const CVec_SignatureZ&) = delete; - ~CVec_SignatureZ() { CVec_SignatureZ_free(self); } - CVec_SignatureZ(CVec_SignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SignatureZ)); } - CVec_SignatureZ(LDKCVec_SignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SignatureZ)); } - operator LDKCVec_SignatureZ() { LDKCVec_SignatureZ res = self; memset(&self, 0, sizeof(LDKCVec_SignatureZ)); return res; } - LDKCVec_SignatureZ* operator &() { return &self; } - LDKCVec_SignatureZ* operator ->() { return &self; } - const LDKCVec_SignatureZ* operator &() const { return &self; } - const LDKCVec_SignatureZ* operator ->() const { return &self; } + CVec_ChannelDetailsZ(const CVec_ChannelDetailsZ&) = delete; + ~CVec_ChannelDetailsZ() { CVec_ChannelDetailsZ_free(self); } + CVec_ChannelDetailsZ(CVec_ChannelDetailsZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_ChannelDetailsZ)); } + CVec_ChannelDetailsZ(LDKCVec_ChannelDetailsZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_ChannelDetailsZ)); } + operator LDKCVec_ChannelDetailsZ() { LDKCVec_ChannelDetailsZ res = self; memset(&self, 0, sizeof(LDKCVec_ChannelDetailsZ)); return res; } + LDKCVec_ChannelDetailsZ* operator &() { return &self; } + LDKCVec_ChannelDetailsZ* operator ->() { return &self; } + const LDKCVec_ChannelDetailsZ* operator &() const { return &self; } + const LDKCVec_ChannelDetailsZ* operator ->() const { return &self; } }; -class CVec_usizeZ { +class C2Tuple_u64u64Z { private: - LDKCVec_usizeZ self; + LDKC2Tuple_u64u64Z self; public: - CVec_usizeZ(const CVec_usizeZ&) = delete; - ~CVec_usizeZ() { CVec_usizeZ_free(self); } - CVec_usizeZ(CVec_usizeZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_usizeZ)); } - CVec_usizeZ(LDKCVec_usizeZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_usizeZ)); } - operator LDKCVec_usizeZ() { LDKCVec_usizeZ res = self; memset(&self, 0, sizeof(LDKCVec_usizeZ)); return res; } - LDKCVec_usizeZ* operator &() { return &self; } - LDKCVec_usizeZ* operator ->() { return &self; } - const LDKCVec_usizeZ* operator &() const { return &self; } - const LDKCVec_usizeZ* operator ->() const { return &self; } + C2Tuple_u64u64Z(const C2Tuple_u64u64Z&) = delete; + ~C2Tuple_u64u64Z() { C2Tuple_u64u64Z_free(self); } + C2Tuple_u64u64Z(C2Tuple_u64u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_u64u64Z)); } + C2Tuple_u64u64Z(LDKC2Tuple_u64u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_u64u64Z)); } + operator LDKC2Tuple_u64u64Z() { LDKC2Tuple_u64u64Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_u64u64Z)); return res; } + LDKC2Tuple_u64u64Z* operator &() { return &self; } + LDKC2Tuple_u64u64Z* operator ->() { return &self; } + const LDKC2Tuple_u64u64Z* operator &() const { return &self; } + const LDKC2Tuple_u64u64Z* operator ->() const { return &self; } }; -class C2Tuple_Scriptu64Z { +class CResult_NonePaymentSendFailureZ { private: - LDKC2Tuple_Scriptu64Z self; + LDKCResult_NonePaymentSendFailureZ self; public: - C2Tuple_Scriptu64Z(const C2Tuple_Scriptu64Z&) = delete; - ~C2Tuple_Scriptu64Z() { C2Tuple_Scriptu64Z_free(self); } - C2Tuple_Scriptu64Z(C2Tuple_Scriptu64Z&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_Scriptu64Z)); } - C2Tuple_Scriptu64Z(LDKC2Tuple_Scriptu64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_Scriptu64Z)); } - operator LDKC2Tuple_Scriptu64Z() { LDKC2Tuple_Scriptu64Z res = self; memset(&self, 0, sizeof(LDKC2Tuple_Scriptu64Z)); return res; } - LDKC2Tuple_Scriptu64Z* operator &() { return &self; } - LDKC2Tuple_Scriptu64Z* operator ->() { return &self; } - const LDKC2Tuple_Scriptu64Z* operator &() const { return &self; } - const LDKC2Tuple_Scriptu64Z* operator ->() const { return &self; } + CResult_NonePaymentSendFailureZ(const CResult_NonePaymentSendFailureZ&) = delete; + ~CResult_NonePaymentSendFailureZ() { CResult_NonePaymentSendFailureZ_free(self); } + CResult_NonePaymentSendFailureZ(CResult_NonePaymentSendFailureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); } + CResult_NonePaymentSendFailureZ(LDKCResult_NonePaymentSendFailureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); } + operator LDKCResult_NonePaymentSendFailureZ() { LDKCResult_NonePaymentSendFailureZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); return res; } + LDKCResult_NonePaymentSendFailureZ* operator &() { return &self; } + LDKCResult_NonePaymentSendFailureZ* operator ->() { return &self; } + const LDKCResult_NonePaymentSendFailureZ* operator &() const { return &self; } + const LDKCResult_NonePaymentSendFailureZ* operator ->() const { return &self; } }; class CResult_NoneChannelMonitorUpdateErrZ { private: @@ -1662,89 +1690,117 @@ public: const LDKCResult_NoneChannelMonitorUpdateErrZ* operator &() const { return &self; } const LDKCResult_NoneChannelMonitorUpdateErrZ* operator ->() const { return &self; } }; -class CVec_u64Z { +class CVec_MonitorEventZ { private: - LDKCVec_u64Z self; + LDKCVec_MonitorEventZ self; public: - CVec_u64Z(const CVec_u64Z&) = delete; - ~CVec_u64Z() { CVec_u64Z_free(self); } - CVec_u64Z(CVec_u64Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u64Z)); } - CVec_u64Z(LDKCVec_u64Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u64Z)); } - operator LDKCVec_u64Z() { LDKCVec_u64Z res = self; memset(&self, 0, sizeof(LDKCVec_u64Z)); return res; } - LDKCVec_u64Z* operator &() { return &self; } - LDKCVec_u64Z* operator ->() { return &self; } - const LDKCVec_u64Z* operator &() const { return &self; } - const LDKCVec_u64Z* operator ->() const { return &self; } + CVec_MonitorEventZ(const CVec_MonitorEventZ&) = delete; + ~CVec_MonitorEventZ() { CVec_MonitorEventZ_free(self); } + CVec_MonitorEventZ(CVec_MonitorEventZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_MonitorEventZ)); } + CVec_MonitorEventZ(LDKCVec_MonitorEventZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_MonitorEventZ)); } + operator LDKCVec_MonitorEventZ() { LDKCVec_MonitorEventZ res = self; memset(&self, 0, sizeof(LDKCVec_MonitorEventZ)); return res; } + LDKCVec_MonitorEventZ* operator &() { return &self; } + LDKCVec_MonitorEventZ* operator ->() { return &self; } + const LDKCVec_MonitorEventZ* operator &() const { return &self; } + const LDKCVec_MonitorEventZ* operator ->() const { return &self; } }; -class C2Tuple_OutPointScriptZ { +class CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ { private: - LDKC2Tuple_OutPointScriptZ self; + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ self; public: - C2Tuple_OutPointScriptZ(const C2Tuple_OutPointScriptZ&) = delete; - ~C2Tuple_OutPointScriptZ() { C2Tuple_OutPointScriptZ_free(self); } - C2Tuple_OutPointScriptZ(C2Tuple_OutPointScriptZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_OutPointScriptZ)); } - C2Tuple_OutPointScriptZ(LDKC2Tuple_OutPointScriptZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_OutPointScriptZ)); } - operator LDKC2Tuple_OutPointScriptZ() { LDKC2Tuple_OutPointScriptZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_OutPointScriptZ)); return res; } - LDKC2Tuple_OutPointScriptZ* operator &() { return &self; } - LDKC2Tuple_OutPointScriptZ* operator ->() { return &self; } - const LDKC2Tuple_OutPointScriptZ* operator &() const { return &self; } - const LDKC2Tuple_OutPointScriptZ* operator ->() const { return &self; } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(const CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&) = delete; + ~CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(self); } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } + CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); } + operator LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ() { LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = self; memset(&self, 0, sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ)); return res; } + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() { return &self; } + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() { return &self; } + const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator &() const { return &self; } + const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* operator ->() const { return &self; } }; -class CVec_ChannelMonitorZ { +class C2Tuple_HTLCOutputInCommitmentSignatureZ { private: - LDKCVec_ChannelMonitorZ self; + LDKC2Tuple_HTLCOutputInCommitmentSignatureZ self; public: - CVec_ChannelMonitorZ(const CVec_ChannelMonitorZ&) = delete; - ~CVec_ChannelMonitorZ() { CVec_ChannelMonitorZ_free(self); } - CVec_ChannelMonitorZ(CVec_ChannelMonitorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_ChannelMonitorZ)); } - CVec_ChannelMonitorZ(LDKCVec_ChannelMonitorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_ChannelMonitorZ)); } - operator LDKCVec_ChannelMonitorZ() { LDKCVec_ChannelMonitorZ res = self; memset(&self, 0, sizeof(LDKCVec_ChannelMonitorZ)); return res; } - LDKCVec_ChannelMonitorZ* operator &() { return &self; } - LDKCVec_ChannelMonitorZ* operator ->() { return &self; } - const LDKCVec_ChannelMonitorZ* operator &() const { return &self; } - const LDKCVec_ChannelMonitorZ* operator ->() const { return &self; } + C2Tuple_HTLCOutputInCommitmentSignatureZ(const C2Tuple_HTLCOutputInCommitmentSignatureZ&) = delete; + ~C2Tuple_HTLCOutputInCommitmentSignatureZ() { C2Tuple_HTLCOutputInCommitmentSignatureZ_free(self); } + C2Tuple_HTLCOutputInCommitmentSignatureZ(C2Tuple_HTLCOutputInCommitmentSignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(C2Tuple_HTLCOutputInCommitmentSignatureZ)); } + C2Tuple_HTLCOutputInCommitmentSignatureZ(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ)); } + operator LDKC2Tuple_HTLCOutputInCommitmentSignatureZ() { LDKC2Tuple_HTLCOutputInCommitmentSignatureZ res = self; memset(&self, 0, sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ)); return res; } + LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator &() { return &self; } + LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator ->() { return &self; } + const LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator &() const { return &self; } + const LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* operator ->() const { return &self; } }; -class CVec_UpdateFulfillHTLCZ { +class CResult_SecretKeySecpErrorZ { private: - LDKCVec_UpdateFulfillHTLCZ self; + LDKCResult_SecretKeySecpErrorZ self; public: - CVec_UpdateFulfillHTLCZ(const CVec_UpdateFulfillHTLCZ&) = delete; - ~CVec_UpdateFulfillHTLCZ() { CVec_UpdateFulfillHTLCZ_free(self); } - CVec_UpdateFulfillHTLCZ(CVec_UpdateFulfillHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFulfillHTLCZ)); } - CVec_UpdateFulfillHTLCZ(LDKCVec_UpdateFulfillHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFulfillHTLCZ)); } - operator LDKCVec_UpdateFulfillHTLCZ() { LDKCVec_UpdateFulfillHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFulfillHTLCZ)); return res; } - LDKCVec_UpdateFulfillHTLCZ* operator &() { return &self; } - LDKCVec_UpdateFulfillHTLCZ* operator ->() { return &self; } - const LDKCVec_UpdateFulfillHTLCZ* operator &() const { return &self; } - const LDKCVec_UpdateFulfillHTLCZ* operator ->() const { return &self; } + 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 CResult_C2Tuple_Scriptu64ZChainErrorZ { +class CVec_RouteHintZ { private: - LDKCResult_C2Tuple_Scriptu64ZChainErrorZ self; + LDKCVec_RouteHintZ self; public: - CResult_C2Tuple_Scriptu64ZChainErrorZ(const CResult_C2Tuple_Scriptu64ZChainErrorZ&) = delete; - ~CResult_C2Tuple_Scriptu64ZChainErrorZ() { CResult_C2Tuple_Scriptu64ZChainErrorZ_free(self); } - CResult_C2Tuple_Scriptu64ZChainErrorZ(CResult_C2Tuple_Scriptu64ZChainErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_Scriptu64ZChainErrorZ)); } - CResult_C2Tuple_Scriptu64ZChainErrorZ(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ)); } - operator LDKCResult_C2Tuple_Scriptu64ZChainErrorZ() { LDKCResult_C2Tuple_Scriptu64ZChainErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ)); return res; } - LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator &() { return &self; } - LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator ->() { return &self; } - const LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator &() const { return &self; } - const LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* operator ->() const { return &self; } + CVec_RouteHintZ(const CVec_RouteHintZ&) = delete; + ~CVec_RouteHintZ() { CVec_RouteHintZ_free(self); } + CVec_RouteHintZ(CVec_RouteHintZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_RouteHintZ)); } + CVec_RouteHintZ(LDKCVec_RouteHintZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_RouteHintZ)); } + operator LDKCVec_RouteHintZ() { LDKCVec_RouteHintZ res = self; memset(&self, 0, sizeof(LDKCVec_RouteHintZ)); return res; } + LDKCVec_RouteHintZ* operator &() { return &self; } + LDKCVec_RouteHintZ* operator ->() { return &self; } + const LDKCVec_RouteHintZ* operator &() const { return &self; } + const LDKCVec_RouteHintZ* operator ->() const { return &self; } }; -class CVec_ChannelDetailsZ { +class CVec_UpdateFailMalformedHTLCZ { private: - LDKCVec_ChannelDetailsZ self; + LDKCVec_UpdateFailMalformedHTLCZ self; public: - CVec_ChannelDetailsZ(const CVec_ChannelDetailsZ&) = delete; - ~CVec_ChannelDetailsZ() { CVec_ChannelDetailsZ_free(self); } - CVec_ChannelDetailsZ(CVec_ChannelDetailsZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_ChannelDetailsZ)); } - CVec_ChannelDetailsZ(LDKCVec_ChannelDetailsZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_ChannelDetailsZ)); } - operator LDKCVec_ChannelDetailsZ() { LDKCVec_ChannelDetailsZ res = self; memset(&self, 0, sizeof(LDKCVec_ChannelDetailsZ)); return res; } - LDKCVec_ChannelDetailsZ* operator &() { return &self; } - LDKCVec_ChannelDetailsZ* operator ->() { return &self; } - const LDKCVec_ChannelDetailsZ* operator &() const { return &self; } - const LDKCVec_ChannelDetailsZ* operator ->() const { return &self; } + CVec_UpdateFailMalformedHTLCZ(const CVec_UpdateFailMalformedHTLCZ&) = delete; + ~CVec_UpdateFailMalformedHTLCZ() { CVec_UpdateFailMalformedHTLCZ_free(self); } + CVec_UpdateFailMalformedHTLCZ(CVec_UpdateFailMalformedHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFailMalformedHTLCZ)); } + CVec_UpdateFailMalformedHTLCZ(LDKCVec_UpdateFailMalformedHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFailMalformedHTLCZ)); } + operator LDKCVec_UpdateFailMalformedHTLCZ() { LDKCVec_UpdateFailMalformedHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFailMalformedHTLCZ)); return res; } + LDKCVec_UpdateFailMalformedHTLCZ* operator &() { return &self; } + LDKCVec_UpdateFailMalformedHTLCZ* operator ->() { return &self; } + const LDKCVec_UpdateFailMalformedHTLCZ* operator &() const { return &self; } + const LDKCVec_UpdateFailMalformedHTLCZ* operator ->() const { return &self; } +}; +class CVec_RouteHopZ { +private: + LDKCVec_RouteHopZ self; +public: + CVec_RouteHopZ(const CVec_RouteHopZ&) = delete; + ~CVec_RouteHopZ() { CVec_RouteHopZ_free(self); } + CVec_RouteHopZ(CVec_RouteHopZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_RouteHopZ)); } + CVec_RouteHopZ(LDKCVec_RouteHopZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_RouteHopZ)); } + operator LDKCVec_RouteHopZ() { LDKCVec_RouteHopZ res = self; memset(&self, 0, sizeof(LDKCVec_RouteHopZ)); return res; } + LDKCVec_RouteHopZ* operator &() { return &self; } + LDKCVec_RouteHopZ* operator ->() { return &self; } + const LDKCVec_RouteHopZ* operator &() const { return &self; } + const LDKCVec_RouteHopZ* operator ->() const { return &self; } +}; +class CVec_SpendableOutputDescriptorZ { +private: + LDKCVec_SpendableOutputDescriptorZ self; +public: + CVec_SpendableOutputDescriptorZ(const CVec_SpendableOutputDescriptorZ&) = delete; + ~CVec_SpendableOutputDescriptorZ() { CVec_SpendableOutputDescriptorZ_free(self); } + CVec_SpendableOutputDescriptorZ(CVec_SpendableOutputDescriptorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SpendableOutputDescriptorZ)); } + CVec_SpendableOutputDescriptorZ(LDKCVec_SpendableOutputDescriptorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SpendableOutputDescriptorZ)); } + operator LDKCVec_SpendableOutputDescriptorZ() { LDKCVec_SpendableOutputDescriptorZ res = self; memset(&self, 0, sizeof(LDKCVec_SpendableOutputDescriptorZ)); return res; } + LDKCVec_SpendableOutputDescriptorZ* operator &() { return &self; } + LDKCVec_SpendableOutputDescriptorZ* operator ->() { return &self; } + const LDKCVec_SpendableOutputDescriptorZ* operator &() const { return &self; } + const LDKCVec_SpendableOutputDescriptorZ* operator ->() const { return &self; } }; class CResult_boolLightningErrorZ { private: @@ -1760,6 +1816,20 @@ public: const LDKCResult_boolLightningErrorZ* operator &() const { return &self; } const LDKCResult_boolLightningErrorZ* operator ->() const { return &self; } }; +class CResult_NoneAPIErrorZ { +private: + LDKCResult_NoneAPIErrorZ self; +public: + CResult_NoneAPIErrorZ(const CResult_NoneAPIErrorZ&) = delete; + ~CResult_NoneAPIErrorZ() { CResult_NoneAPIErrorZ_free(self); } + CResult_NoneAPIErrorZ(CResult_NoneAPIErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NoneAPIErrorZ)); } + CResult_NoneAPIErrorZ(LDKCResult_NoneAPIErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NoneAPIErrorZ)); } + operator LDKCResult_NoneAPIErrorZ() { LDKCResult_NoneAPIErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NoneAPIErrorZ)); return res; } + LDKCResult_NoneAPIErrorZ* operator &() { return &self; } + LDKCResult_NoneAPIErrorZ* operator ->() { return &self; } + const LDKCResult_NoneAPIErrorZ* operator &() const { return &self; } + const LDKCResult_NoneAPIErrorZ* operator ->() const { return &self; } +}; class CVec_NetAddressZ { private: LDKCVec_NetAddressZ self; @@ -1774,75 +1844,61 @@ public: const LDKCVec_NetAddressZ* operator &() const { return &self; } const LDKCVec_NetAddressZ* 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 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { +class CResult_CVec_u8ZPeerHandleErrorZ { private: - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ self; + LDKCResult_CVec_u8ZPeerHandleErrorZ self; public: - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(const C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&) = delete; - ~C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ() { C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(self); } - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&& o) : self(o.self) { memset(&o, 0, sizeof(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); } - C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); } - operator LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ() { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ res = self; memset(&self, 0, sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); return res; } - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() { return &self; } - LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() { return &self; } - const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() const { return &self; } - const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() const { return &self; } + CResult_CVec_u8ZPeerHandleErrorZ(const CResult_CVec_u8ZPeerHandleErrorZ&) = delete; + ~CResult_CVec_u8ZPeerHandleErrorZ() { CResult_CVec_u8ZPeerHandleErrorZ_free(self); } + CResult_CVec_u8ZPeerHandleErrorZ(CResult_CVec_u8ZPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_CVec_u8ZPeerHandleErrorZ)); } + CResult_CVec_u8ZPeerHandleErrorZ(LDKCResult_CVec_u8ZPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); } + operator LDKCResult_CVec_u8ZPeerHandleErrorZ() { LDKCResult_CVec_u8ZPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ)); return res; } + LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() { return &self; } + LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() { return &self; } + const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator &() const { return &self; } + const LDKCResult_CVec_u8ZPeerHandleErrorZ* operator ->() const { return &self; } }; -class CVec_MonitorEventZ { +class CVec_usizeZ { private: - LDKCVec_MonitorEventZ self; + LDKCVec_usizeZ self; public: - CVec_MonitorEventZ(const CVec_MonitorEventZ&) = delete; - ~CVec_MonitorEventZ() { CVec_MonitorEventZ_free(self); } - CVec_MonitorEventZ(CVec_MonitorEventZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_MonitorEventZ)); } - CVec_MonitorEventZ(LDKCVec_MonitorEventZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_MonitorEventZ)); } - operator LDKCVec_MonitorEventZ() { LDKCVec_MonitorEventZ res = self; memset(&self, 0, sizeof(LDKCVec_MonitorEventZ)); return res; } - LDKCVec_MonitorEventZ* operator &() { return &self; } - LDKCVec_MonitorEventZ* operator ->() { return &self; } - const LDKCVec_MonitorEventZ* operator &() const { return &self; } - const LDKCVec_MonitorEventZ* operator ->() const { return &self; } + CVec_usizeZ(const CVec_usizeZ&) = delete; + ~CVec_usizeZ() { CVec_usizeZ_free(self); } + CVec_usizeZ(CVec_usizeZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_usizeZ)); } + CVec_usizeZ(LDKCVec_usizeZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_usizeZ)); } + operator LDKCVec_usizeZ() { LDKCVec_usizeZ res = self; memset(&self, 0, sizeof(LDKCVec_usizeZ)); return res; } + LDKCVec_usizeZ* operator &() { return &self; } + LDKCVec_usizeZ* operator ->() { return &self; } + const LDKCVec_usizeZ* operator &() const { return &self; } + const LDKCVec_usizeZ* operator ->() const { return &self; } }; -class CVec_UpdateAddHTLCZ { +class CResult_NonePeerHandleErrorZ { private: - LDKCVec_UpdateAddHTLCZ self; + LDKCResult_NonePeerHandleErrorZ self; public: - CVec_UpdateAddHTLCZ(const CVec_UpdateAddHTLCZ&) = delete; - ~CVec_UpdateAddHTLCZ() { CVec_UpdateAddHTLCZ_free(self); } - CVec_UpdateAddHTLCZ(CVec_UpdateAddHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); } - CVec_UpdateAddHTLCZ(LDKCVec_UpdateAddHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); } - operator LDKCVec_UpdateAddHTLCZ() { LDKCVec_UpdateAddHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); return res; } - LDKCVec_UpdateAddHTLCZ* operator &() { return &self; } - LDKCVec_UpdateAddHTLCZ* operator ->() { return &self; } - const LDKCVec_UpdateAddHTLCZ* operator &() const { return &self; } - const LDKCVec_UpdateAddHTLCZ* operator ->() const { return &self; } + CResult_NonePeerHandleErrorZ(const CResult_NonePeerHandleErrorZ&) = delete; + ~CResult_NonePeerHandleErrorZ() { CResult_NonePeerHandleErrorZ_free(self); } + CResult_NonePeerHandleErrorZ(CResult_NonePeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); } + CResult_NonePeerHandleErrorZ(LDKCResult_NonePeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); } + operator LDKCResult_NonePeerHandleErrorZ() { LDKCResult_NonePeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); return res; } + LDKCResult_NonePeerHandleErrorZ* operator &() { return &self; } + LDKCResult_NonePeerHandleErrorZ* operator ->() { return &self; } + const LDKCResult_NonePeerHandleErrorZ* operator &() const { return &self; } + const LDKCResult_NonePeerHandleErrorZ* operator ->() const { return &self; } }; -class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { +class CResult_TxCreationKeysSecpErrorZ { private: - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ self; + LDKCResult_TxCreationKeysSecpErrorZ self; public: - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(const CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&) = delete; - ~CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); } - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } - CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } - operator LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return res; } - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() { return &self; } - LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() { return &self; } - const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() const { return &self; } - const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() const { return &self; } + CResult_TxCreationKeysSecpErrorZ(const CResult_TxCreationKeysSecpErrorZ&) = delete; + ~CResult_TxCreationKeysSecpErrorZ() { CResult_TxCreationKeysSecpErrorZ_free(self); } + CResult_TxCreationKeysSecpErrorZ(CResult_TxCreationKeysSecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_TxCreationKeysSecpErrorZ)); } + CResult_TxCreationKeysSecpErrorZ(LDKCResult_TxCreationKeysSecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); } + operator LDKCResult_TxCreationKeysSecpErrorZ() { LDKCResult_TxCreationKeysSecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_TxCreationKeysSecpErrorZ)); return res; } + LDKCResult_TxCreationKeysSecpErrorZ* operator &() { return &self; } + LDKCResult_TxCreationKeysSecpErrorZ* operator ->() { return &self; } + const LDKCResult_TxCreationKeysSecpErrorZ* operator &() const { return &self; } + const LDKCResult_TxCreationKeysSecpErrorZ* operator ->() const { return &self; } }; class CVec_PublicKeyZ { private: @@ -1858,89 +1914,89 @@ public: const LDKCVec_PublicKeyZ* operator &() const { return &self; } const LDKCVec_PublicKeyZ* operator ->() const { return &self; } }; -class CResult_NonePeerHandleErrorZ { +class CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ { private: - LDKCResult_NonePeerHandleErrorZ self; + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ self; public: - CResult_NonePeerHandleErrorZ(const CResult_NonePeerHandleErrorZ&) = delete; - ~CResult_NonePeerHandleErrorZ() { CResult_NonePeerHandleErrorZ_free(self); } - CResult_NonePeerHandleErrorZ(CResult_NonePeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePeerHandleErrorZ)); } - CResult_NonePeerHandleErrorZ(LDKCResult_NonePeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); } - operator LDKCResult_NonePeerHandleErrorZ() { LDKCResult_NonePeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePeerHandleErrorZ)); return res; } - LDKCResult_NonePeerHandleErrorZ* operator &() { return &self; } - LDKCResult_NonePeerHandleErrorZ* operator ->() { return &self; } - const LDKCResult_NonePeerHandleErrorZ* operator &() const { return &self; } - const LDKCResult_NonePeerHandleErrorZ* operator ->() const { return &self; } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(const CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&) = delete; + ~CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(self); } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } + CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); } + operator LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ() { LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ)); return res; } + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() { return &self; } + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() { return &self; } + const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator &() const { return &self; } + const LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* operator ->() const { return &self; } }; -class CVec_NodeAnnouncementZ { +class C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ { private: - LDKCVec_NodeAnnouncementZ self; + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ 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; } + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(const C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&) = delete; + ~C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ() { C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(self); } + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&& o) : self(o.self) { memset(&o, 0, sizeof(C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); } + C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); } + operator LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ() { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ res = self; memset(&self, 0, sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ)); return res; } + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() { return &self; } + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() { return &self; } + const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator &() const { return &self; } + const LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* operator ->() const { return &self; } }; -class CResult_boolPeerHandleErrorZ { +class CVec_MessageSendEventZ { private: - LDKCResult_boolPeerHandleErrorZ self; + LDKCVec_MessageSendEventZ self; public: - CResult_boolPeerHandleErrorZ(const CResult_boolPeerHandleErrorZ&) = delete; - ~CResult_boolPeerHandleErrorZ() { CResult_boolPeerHandleErrorZ_free(self); } - CResult_boolPeerHandleErrorZ(CResult_boolPeerHandleErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_boolPeerHandleErrorZ)); } - CResult_boolPeerHandleErrorZ(LDKCResult_boolPeerHandleErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_boolPeerHandleErrorZ)); } - operator LDKCResult_boolPeerHandleErrorZ() { LDKCResult_boolPeerHandleErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_boolPeerHandleErrorZ)); return res; } - LDKCResult_boolPeerHandleErrorZ* operator &() { return &self; } - LDKCResult_boolPeerHandleErrorZ* operator ->() { return &self; } - const LDKCResult_boolPeerHandleErrorZ* operator &() const { return &self; } - const LDKCResult_boolPeerHandleErrorZ* operator ->() const { return &self; } + CVec_MessageSendEventZ(const CVec_MessageSendEventZ&) = delete; + ~CVec_MessageSendEventZ() { CVec_MessageSendEventZ_free(self); } + CVec_MessageSendEventZ(CVec_MessageSendEventZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_MessageSendEventZ)); } + CVec_MessageSendEventZ(LDKCVec_MessageSendEventZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_MessageSendEventZ)); } + operator LDKCVec_MessageSendEventZ() { LDKCVec_MessageSendEventZ res = self; memset(&self, 0, sizeof(LDKCVec_MessageSendEventZ)); return res; } + LDKCVec_MessageSendEventZ* operator &() { return &self; } + LDKCVec_MessageSendEventZ* operator ->() { return &self; } + const LDKCVec_MessageSendEventZ* operator &() const { return &self; } + const LDKCVec_MessageSendEventZ* operator ->() const { return &self; } }; -class CResult_SecretKeySecpErrorZ { +class CVec_UpdateFailHTLCZ { private: - LDKCResult_SecretKeySecpErrorZ self; + LDKCVec_UpdateFailHTLCZ 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_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_TransactionZ { +class CVec_UpdateFulfillHTLCZ { private: - LDKCVec_TransactionZ self; + LDKCVec_UpdateFulfillHTLCZ 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_UpdateFulfillHTLCZ(const CVec_UpdateFulfillHTLCZ&) = delete; + ~CVec_UpdateFulfillHTLCZ() { CVec_UpdateFulfillHTLCZ_free(self); } + CVec_UpdateFulfillHTLCZ(CVec_UpdateFulfillHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateFulfillHTLCZ)); } + CVec_UpdateFulfillHTLCZ(LDKCVec_UpdateFulfillHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateFulfillHTLCZ)); } + operator LDKCVec_UpdateFulfillHTLCZ() { LDKCVec_UpdateFulfillHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateFulfillHTLCZ)); return res; } + LDKCVec_UpdateFulfillHTLCZ* operator &() { return &self; } + LDKCVec_UpdateFulfillHTLCZ* operator ->() { return &self; } + const LDKCVec_UpdateFulfillHTLCZ* operator &() const { return &self; } + const LDKCVec_UpdateFulfillHTLCZ* operator ->() const { return &self; } }; -class CResult_NonePaymentSendFailureZ { +class CVec_UpdateAddHTLCZ { private: - LDKCResult_NonePaymentSendFailureZ self; + LDKCVec_UpdateAddHTLCZ self; public: - CResult_NonePaymentSendFailureZ(const CResult_NonePaymentSendFailureZ&) = delete; - ~CResult_NonePaymentSendFailureZ() { CResult_NonePaymentSendFailureZ_free(self); } - CResult_NonePaymentSendFailureZ(CResult_NonePaymentSendFailureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_NonePaymentSendFailureZ)); } - CResult_NonePaymentSendFailureZ(LDKCResult_NonePaymentSendFailureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); } - operator LDKCResult_NonePaymentSendFailureZ() { LDKCResult_NonePaymentSendFailureZ res = self; memset(&self, 0, sizeof(LDKCResult_NonePaymentSendFailureZ)); return res; } - LDKCResult_NonePaymentSendFailureZ* operator &() { return &self; } - LDKCResult_NonePaymentSendFailureZ* operator ->() { return &self; } - const LDKCResult_NonePaymentSendFailureZ* operator &() const { return &self; } - const LDKCResult_NonePaymentSendFailureZ* operator ->() const { return &self; } + CVec_UpdateAddHTLCZ(const CVec_UpdateAddHTLCZ&) = delete; + ~CVec_UpdateAddHTLCZ() { CVec_UpdateAddHTLCZ_free(self); } + CVec_UpdateAddHTLCZ(CVec_UpdateAddHTLCZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_UpdateAddHTLCZ)); } + CVec_UpdateAddHTLCZ(LDKCVec_UpdateAddHTLCZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); } + operator LDKCVec_UpdateAddHTLCZ() { LDKCVec_UpdateAddHTLCZ res = self; memset(&self, 0, sizeof(LDKCVec_UpdateAddHTLCZ)); return res; } + LDKCVec_UpdateAddHTLCZ* operator &() { return &self; } + LDKCVec_UpdateAddHTLCZ* operator ->() { return &self; } + const LDKCVec_UpdateAddHTLCZ* operator &() const { return &self; } + const LDKCVec_UpdateAddHTLCZ* operator ->() const { return &self; } }; class CVec_EventZ { private: @@ -1956,32 +2012,46 @@ public: const LDKCVec_EventZ* operator &() const { return &self; } const LDKCVec_EventZ* operator ->() const { return &self; } }; -class CVec_u8Z { +class CVec_SignatureZ { private: - LDKCVec_u8Z self; + LDKCVec_SignatureZ self; public: - CVec_u8Z(const CVec_u8Z&) = delete; - ~CVec_u8Z() { CVec_u8Z_free(self); } - CVec_u8Z(CVec_u8Z&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_u8Z)); } - CVec_u8Z(LDKCVec_u8Z&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_u8Z)); } - operator LDKCVec_u8Z() { LDKCVec_u8Z res = self; memset(&self, 0, sizeof(LDKCVec_u8Z)); return res; } - LDKCVec_u8Z* operator &() { return &self; } - LDKCVec_u8Z* operator ->() { return &self; } - const LDKCVec_u8Z* operator &() const { return &self; } - const LDKCVec_u8Z* operator ->() const { return &self; } + CVec_SignatureZ(const CVec_SignatureZ&) = delete; + ~CVec_SignatureZ() { CVec_SignatureZ_free(self); } + CVec_SignatureZ(CVec_SignatureZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_SignatureZ)); } + CVec_SignatureZ(LDKCVec_SignatureZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_SignatureZ)); } + operator LDKCVec_SignatureZ() { LDKCVec_SignatureZ res = self; memset(&self, 0, sizeof(LDKCVec_SignatureZ)); return res; } + LDKCVec_SignatureZ* operator &() { return &self; } + LDKCVec_SignatureZ* operator ->() { return &self; } + const LDKCVec_SignatureZ* operator &() const { return &self; } + const LDKCVec_SignatureZ* operator ->() const { return &self; } }; -class CResult_PublicKeySecpErrorZ { +class CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ { private: - LDKCResult_PublicKeySecpErrorZ self; + LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ self; public: - CResult_PublicKeySecpErrorZ(const CResult_PublicKeySecpErrorZ&) = delete; - ~CResult_PublicKeySecpErrorZ() { CResult_PublicKeySecpErrorZ_free(self); } - CResult_PublicKeySecpErrorZ(CResult_PublicKeySecpErrorZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_PublicKeySecpErrorZ)); } - CResult_PublicKeySecpErrorZ(LDKCResult_PublicKeySecpErrorZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); } - operator LDKCResult_PublicKeySecpErrorZ() { LDKCResult_PublicKeySecpErrorZ res = self; memset(&self, 0, sizeof(LDKCResult_PublicKeySecpErrorZ)); return res; } - LDKCResult_PublicKeySecpErrorZ* operator &() { return &self; } - LDKCResult_PublicKeySecpErrorZ* operator ->() { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator &() const { return &self; } - const LDKCResult_PublicKeySecpErrorZ* operator ->() const { return &self; } + CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(const CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&) = delete; + ~CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ() { CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(self); } + CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&& o) : self(o.self) { memset(&o, 0, sizeof(CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); } + CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); } + operator LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ() { LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ res = self; memset(&self, 0, sizeof(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ)); return res; } + LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator &() { return &self; } + LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator ->() { return &self; } + const LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator &() const { return &self; } + const LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ* operator ->() const { return &self; } +}; +class CResult_SignatureNoneZ { +private: + LDKCResult_SignatureNoneZ self; +public: + CResult_SignatureNoneZ(const CResult_SignatureNoneZ&) = delete; + ~CResult_SignatureNoneZ() { CResult_SignatureNoneZ_free(self); } + CResult_SignatureNoneZ(CResult_SignatureNoneZ&& o) : self(o.self) { memset(&o, 0, sizeof(CResult_SignatureNoneZ)); } + CResult_SignatureNoneZ(LDKCResult_SignatureNoneZ&& m_self) : self(m_self) { memset(&m_self, 0, sizeof(LDKCResult_SignatureNoneZ)); } + operator LDKCResult_SignatureNoneZ() { LDKCResult_SignatureNoneZ res = self; memset(&self, 0, sizeof(LDKCResult_SignatureNoneZ)); return res; } + LDKCResult_SignatureNoneZ* operator &() { return &self; } + LDKCResult_SignatureNoneZ* operator ->() { return &self; } + const LDKCResult_SignatureNoneZ* operator &() const { return &self; } + const LDKCResult_SignatureNoneZ* operator ->() const { return &self; } }; } diff --git a/lightning-c-bindings/include/rust_types.h b/lightning-c-bindings/include/rust_types.h index 3b6821aa6..e328836e1 100644 --- a/lightning-c-bindings/include/rust_types.h +++ b/lightning-c-bindings/include/rust_types.h @@ -104,6 +104,16 @@ struct nativeUnsignedChannelUpdateOpaque; typedef struct nativeUnsignedChannelUpdateOpaque LDKnativeUnsignedChannelUpdate; struct nativeChannelUpdateOpaque; typedef struct nativeChannelUpdateOpaque LDKnativeChannelUpdate; +struct nativeQueryChannelRangeOpaque; +typedef struct nativeQueryChannelRangeOpaque LDKnativeQueryChannelRange; +struct nativeReplyChannelRangeOpaque; +typedef struct nativeReplyChannelRangeOpaque LDKnativeReplyChannelRange; +struct nativeQueryShortChannelIdsOpaque; +typedef struct nativeQueryShortChannelIdsOpaque LDKnativeQueryShortChannelIds; +struct nativeReplyShortChannelIdsEndOpaque; +typedef struct nativeReplyShortChannelIdsEndOpaque LDKnativeReplyShortChannelIdsEnd; +struct nativeGossipTimestampFilterOpaque; +typedef struct nativeGossipTimestampFilterOpaque LDKnativeGossipTimestampFilter; struct nativeLightningErrorOpaque; typedef struct nativeLightningErrorOpaque LDKnativeLightningError; struct nativeCommitmentUpdateOpaque; @@ -122,8 +132,8 @@ struct nativeChannelPublicKeysOpaque; typedef struct nativeChannelPublicKeysOpaque LDKnativeChannelPublicKeys; struct nativeHTLCOutputInCommitmentOpaque; typedef struct nativeHTLCOutputInCommitmentOpaque LDKnativeHTLCOutputInCommitment; -struct nativeLocalCommitmentTransactionOpaque; -typedef struct nativeLocalCommitmentTransactionOpaque LDKnativeLocalCommitmentTransaction; +struct nativeHolderCommitmentTransactionOpaque; +typedef struct nativeHolderCommitmentTransactionOpaque LDKnativeHolderCommitmentTransaction; struct nativeInitFeaturesOpaque; typedef struct nativeInitFeaturesOpaque LDKnativeInitFeatures; struct nativeNodeFeaturesOpaque; diff --git a/lightning-c-bindings/src/c_types/derived.rs b/lightning-c-bindings/src/c_types/derived.rs index 8d1e8041b..16463a189 100644 --- a/lightning-c-bindings/src/c_types/derived.rs +++ b/lightning-c-bindings/src/c_types/derived.rs @@ -216,6 +216,11 @@ pub extern "C" fn C2Tuple_OutPointScriptZ_new(a: crate::chain::transaction::OutP } } +#[no_mangle] +pub type CVec_u64Z = crate::c_types::CVecTempl; +#[no_mangle] +pub static CVec_u64Z_free: extern "C" fn(CVec_u64Z) = crate::c_types::CVecTempl_free::; + #[no_mangle] pub type CVec_UpdateAddHTLCZ = crate::c_types::CVecTempl; #[no_mangle] @@ -398,8 +403,3 @@ pub static CResult_RouteLightningErrorZ_ok: extern "C" fn (crate::routing::route pub static CResult_RouteLightningErrorZ_err: extern "C" fn (crate::ln::msgs::LightningError) -> CResult_RouteLightningErrorZ = crate::c_types::CResultTempl::::err; -#[no_mangle] -pub type CVec_u64Z = crate::c_types::CVecTempl; -#[no_mangle] -pub static CVec_u64Z_free: extern "C" fn(CVec_u64Z) = crate::c_types::CVecTempl_free::; - diff --git a/lightning-c-bindings/src/chain/keysinterface.rs b/lightning-c-bindings/src/chain/keysinterface.rs index c68c219c2..290b29553 100644 --- a/lightning-c-bindings/src/chain/keysinterface.rs +++ b/lightning-c-bindings/src/chain/keysinterface.rs @@ -44,7 +44,7 @@ pub enum SpendableOutputDescriptor { /// ChannelKeys::pubkeys(). /// /// To derive the revocation_pubkey provided here (which is used in the witness - /// script generation), you must pass the revocation_basepoint (which appears in the + /// script generation), you must pass the counterparty revocation_basepoint (which appears in the /// call to ChannelKeys::on_accept) and the provided per_commitment point /// to chan_utils::derive_public_revocation_key. /// @@ -261,7 +261,7 @@ pub struct ChannelKeys { /// TODO: return a Result so we can signal a validation error #[must_use] pub release_commitment_secret: extern "C" fn (this_arg: *const c_void, idx: u64) -> crate::c_types::ThirtyTwoBytes, - /// Gets the local channel public keys and basepoints + /// Gets the holder's channel public keys and basepoints pub pubkeys: crate::ln::chan_utils::ChannelPublicKeys, /// Fill in the pubkeys field as a reference to it will be given to Rust after this returns /// Note that this takes a pointer to this object, not the this_ptr like other methods do @@ -272,18 +272,18 @@ pub struct ChannelKeys { /// ChannelKeys object uniquely and lookup or re-derive its keys. #[must_use] pub key_derivation_params: extern "C" fn (this_arg: *const c_void) -> crate::c_types::derived::C2Tuple_u64u64Z, - /// Create a signature for a counterparty commitment transaction and associated HTLC transactions. + /// Create a signature for a counterparty's commitment transaction and associated HTLC transactions. /// /// Note that if signing fails or is rejected, the channel will be force-closed. #[must_use] pub sign_counterparty_commitment: extern "C" fn (this_arg: *const c_void, feerate_per_kw: u32, commitment_tx: crate::c_types::Transaction, keys: &crate::ln::chan_utils::PreCalculatedTxCreationKeys, htlcs: crate::c_types::derived::CVec_HTLCOutputInCommitmentZ) -> crate::c_types::derived::CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ, - /// Create a signature for a local commitment transaction. This will only ever be called with - /// the same local_commitment_tx (or a copy thereof), though there are currently no guarantees + /// Create a signature for a holder's commitment transaction. This will only ever be called with + /// the same holder_commitment_tx (or a copy thereof), though there are currently no guarantees /// that it will not be called multiple times. /// An external signer implementation should check that the commitment has not been revoked. #[must_use] pub sign_holder_commitment: extern "C" fn (this_arg: *const c_void, holder_commitment_tx: &crate::ln::chan_utils::HolderCommitmentTransaction) -> crate::c_types::derived::CResult_SignatureNoneZ, - /// Create a signature for each HTLC transaction spending a holder commitment transaction. + /// Create a signature for each HTLC transaction spending a holder's commitment transaction. /// /// Unlike sign_holder_commitment, this may be called multiple times with *different* /// holder_commitment_tx values. While this will never be called with a revoked @@ -309,8 +309,8 @@ pub struct ChannelKeys { /// Amount is value of the output spent by this input, committed to in the BIP 143 signature. /// /// per_commitment_key is revocation secret which was provided by our counterparty when they - /// revoked the state which they eventually broadcast. It's not a _local_ secret key and does - /// not allow the spending of any funds by itself (you need our local revocation_secret to do + /// revoked the state which they eventually broadcast. It's not a _holder_ secret key and does + /// not allow the spending of any funds by itself (you need our holder revocation_secret to do /// so). /// /// htlc holds HTLC elements (hash, timelock) if the output being spent is a HTLC output, thus @@ -318,7 +318,7 @@ pub struct ChannelKeys { /// signatures). #[must_use] pub sign_justice_transaction: extern "C" fn (this_arg: *const c_void, justice_tx: crate::c_types::Transaction, input: usize, amount: u64, per_commitment_key: *const [u8; 32], htlc: &crate::ln::chan_utils::HTLCOutputInCommitment) -> crate::c_types::derived::CResult_SignatureNoneZ, - /// Create a signature for a claiming transaction for a HTLC output on a counterparty commitment + /// Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment /// transaction, either offered or received. /// /// Such a transaction may claim multiples offered outputs at same time if we know the @@ -351,13 +351,13 @@ pub struct ChannelKeys { /// protocol. #[must_use] pub sign_channel_announcement: extern "C" fn (this_arg: *const c_void, msg: &crate::ln::msgs::UnsignedChannelAnnouncement) -> crate::c_types::derived::CResult_SignatureNoneZ, - /// Set the counterparty channel basepoints and counterparty/local to_self_delay. + /// Set the counterparty channel basepoints and counterparty_selected/holder_selected_contest_delay. /// This is done immediately on incoming channels and as soon as the channel is accepted on outgoing channels. /// - /// We bind local_to_self_delay late here for API convenience. + /// We bind holder_selected_contest_delay late here for API convenience. /// /// Will be called before any signatures are applied. - pub on_accept: extern "C" fn (this_arg: *mut c_void, channel_points: &crate::ln::chan_utils::ChannelPublicKeys, counterparty_to_self_delay: u16, local_to_self_delay: u16), + pub on_accept: extern "C" fn (this_arg: *mut c_void, channel_points: &crate::ln::chan_utils::ChannelPublicKeys, counterparty_selected_contest_delay: u16, holder_selected_contest_delay: u16), pub clone: Option *mut c_void>, pub free: Option, } @@ -413,13 +413,13 @@ impl rustChannelKeys for ChannelKeys { let mut local_ret = match ret.result_ok { true => Ok( { let (mut orig_ret_0_0, mut orig_ret_0_1) = (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }).to_rust(); let mut local_orig_ret_0_1 = Vec::new(); for mut item in orig_ret_0_1.into_rust().drain(..) { local_orig_ret_0_1.push( { item.into_rust() }); }; let mut local_ret_0 = (orig_ret_0_0.into_rust(), local_orig_ret_0_1); local_ret_0 }), false => Err( { () /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ })}; local_ret } - fn sign_holder_commitment(&self, local_commitment_tx: &lightning::ln::chan_utils::HolderCommitmentTransaction, _secp_ctx: &bitcoin::secp256k1::Secp256k1) -> Result { - let mut ret = (self.sign_holder_commitment)(self.this_arg, &crate::ln::chan_utils::HolderCommitmentTransaction { inner: unsafe { (local_commitment_tx as *const _) as *mut _ }, is_owned: false }); + fn sign_holder_commitment(&self, holder_commitment_tx: &lightning::ln::chan_utils::HolderCommitmentTransaction, _secp_ctx: &bitcoin::secp256k1::Secp256k1) -> Result { + let mut ret = (self.sign_holder_commitment)(self.this_arg, &crate::ln::chan_utils::HolderCommitmentTransaction { inner: unsafe { (holder_commitment_tx 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()) }).into_rust() }), false => Err( { () /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ })}; local_ret } - fn sign_holder_commitment_htlc_transactions(&self, local_commitment_tx: &lightning::ln::chan_utils::HolderCommitmentTransaction, _secp_ctx: &bitcoin::secp256k1::Secp256k1) -> Result>, ()> { - let mut ret = (self.sign_holder_commitment_htlc_transactions)(self.this_arg, &crate::ln::chan_utils::HolderCommitmentTransaction { inner: unsafe { (local_commitment_tx as *const _) as *mut _ }, is_owned: false }); + fn sign_holder_commitment_htlc_transactions(&self, holder_commitment_tx: &lightning::ln::chan_utils::HolderCommitmentTransaction, _secp_ctx: &bitcoin::secp256k1::Secp256k1) -> Result>, ()> { + let mut ret = (self.sign_holder_commitment_htlc_transactions)(self.this_arg, &crate::ln::chan_utils::HolderCommitmentTransaction { inner: unsafe { (holder_commitment_tx as *const _) as *mut _ }, is_owned: false }); let mut local_ret = match ret.result_ok { true => Ok( { let mut local_ret_0 = Vec::new(); for mut item in (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }).into_rust().drain(..) { local_ret_0.push( { let mut local_ret_0_0 = if item.is_null() { None } else { Some( { item.into_rust() }) }; local_ret_0_0 }); }; local_ret_0 }), false => Err( { () /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ })}; local_ret } @@ -447,8 +447,8 @@ impl rustChannelKeys for ChannelKeys { let mut local_ret = match ret.result_ok { true => Ok( { (*unsafe { Box::from_raw(ret.contents.result.take_ptr()) }).into_rust() }), false => Err( { () /*(*unsafe { Box::from_raw(ret.contents.err.take_ptr()) })*/ })}; local_ret } - fn on_accept(&mut self, channel_points: &lightning::ln::chan_utils::ChannelPublicKeys, counterparty_to_self_delay: u16, local_to_self_delay: u16) { - (self.on_accept)(self.this_arg, &crate::ln::chan_utils::ChannelPublicKeys { inner: unsafe { (channel_points as *const _) as *mut _ }, is_owned: false }, counterparty_to_self_delay, local_to_self_delay) + fn on_accept(&mut self, channel_points: &lightning::ln::chan_utils::ChannelPublicKeys, counterparty_selected_contest_delay: u16, holder_selected_contest_delay: u16) { + (self.on_accept)(self.this_arg, &crate::ln::chan_utils::ChannelPublicKeys { inner: unsafe { (channel_points as *const _) as *mut _ }, is_owned: false }, counterparty_selected_contest_delay, holder_selected_contest_delay) } } @@ -602,46 +602,46 @@ pub extern "C" fn InMemoryChannelKeys_get_funding_key(this_ptr: &InMemoryChannel pub extern "C" fn InMemoryChannelKeys_set_funding_key(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::SecretKey) { unsafe { &mut *this_ptr.inner }.funding_key = val.into_rust(); } -/// Local secret key for blinded revocation pubkey +/// Holder secret key for blinded revocation pubkey #[no_mangle] pub extern "C" fn InMemoryChannelKeys_get_revocation_base_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.revocation_base_key; (*inner_val).as_ref() } -/// Local secret key for blinded revocation pubkey +/// Holder secret key for blinded revocation pubkey #[no_mangle] pub extern "C" fn InMemoryChannelKeys_set_revocation_base_key(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::SecretKey) { unsafe { &mut *this_ptr.inner }.revocation_base_key = val.into_rust(); } -/// Local secret key used for our balance in counterparty-broadcasted commitment transactions +/// Holder secret key used for our balance in counterparty-broadcasted commitment transactions #[no_mangle] pub extern "C" fn InMemoryChannelKeys_get_payment_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_key; (*inner_val).as_ref() } -/// Local secret key used for our balance in counterparty-broadcasted commitment transactions +/// Holder secret key used for our balance in counterparty-broadcasted commitment transactions #[no_mangle] pub extern "C" fn InMemoryChannelKeys_set_payment_key(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::SecretKey) { unsafe { &mut *this_ptr.inner }.payment_key = val.into_rust(); } -/// Local secret key used in HTLC tx +/// Holder secret key used in HTLC tx #[no_mangle] pub extern "C" fn InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.delayed_payment_base_key; (*inner_val).as_ref() } -/// Local secret key used in HTLC tx +/// Holder secret key used in HTLC tx #[no_mangle] pub extern "C" fn InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::SecretKey) { unsafe { &mut *this_ptr.inner }.delayed_payment_base_key = val.into_rust(); } -/// Local htlc secret key used in commitment tx htlc outputs +/// Holder htlc secret key used in commitment tx htlc outputs #[no_mangle] pub extern "C" fn InMemoryChannelKeys_get_htlc_base_key(this_ptr: &InMemoryChannelKeys) -> *const [u8; 32] { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.htlc_base_key; (*inner_val).as_ref() } -/// Local htlc secret key used in commitment tx htlc outputs +/// Holder htlc secret key used in commitment tx htlc outputs #[no_mangle] pub extern "C" fn InMemoryChannelKeys_set_htlc_base_key(this_ptr: &mut InMemoryChannelKeys, mut val: crate::c_types::SecretKey) { unsafe { &mut *this_ptr.inner }.htlc_base_key = val.into_rust(); @@ -675,10 +675,10 @@ pub extern "C" fn InMemoryChannelKeys_counterparty_pubkeys(this_arg: &InMemoryCh crate::ln::chan_utils::ChannelPublicKeys { inner: unsafe { ( (&(*ret) as *const _) as *mut _) }, is_owned: false } } -/// The contest delay value specified by our counterparty and applied on holder-broadcastable +/// The contest_delay value specified by our counterparty and applied on holder-broadcastable /// transactions, ie the amount of time that we have to wait to recover our funds if we /// broadcast a transaction. You'll likely want to pass this to the -/// ln::chan_utils::build*_transaction functions when signing holder transactions. +/// ln::chan_utils::build*_transaction functions when signing holder's transactions. /// Will panic if on_accept wasn't called. #[must_use] #[no_mangle] @@ -687,7 +687,7 @@ pub extern "C" fn InMemoryChannelKeys_counterparty_selected_contest_delay(this_a ret } -/// The to_contest delay value specified by us and applied on transactions broadcastable +/// The contest_delay value specified by us and applied on transactions broadcastable /// by our counterparty, ie the amount of time that they have to wait to recover their funds /// if they broadcast a transaction. /// Will panic if on_accept wasn't called. @@ -757,14 +757,14 @@ extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_counterparty_commitment(this_ local_ret } #[must_use] -extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment(this_arg: *const c_void, local_commitment_tx: &crate::ln::chan_utils::HolderCommitmentTransaction) -> crate::c_types::derived::CResult_SignatureNoneZ { - let mut ret = unsafe { &mut *(this_arg as *mut nativeInMemoryChannelKeys) }.sign_holder_commitment(unsafe { &*local_commitment_tx.inner }, &bitcoin::secp256k1::Secp256k1::new()); +extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment(this_arg: *const c_void, holder_commitment_tx: &crate::ln::chan_utils::HolderCommitmentTransaction) -> crate::c_types::derived::CResult_SignatureNoneZ { + let mut ret = unsafe { &mut *(this_arg as *mut nativeInMemoryChannelKeys) }.sign_holder_commitment(unsafe { &*holder_commitment_tx.inner }, &bitcoin::secp256k1::Secp256k1::new()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::Signature::from_rust(&o) }), Err(mut e) => crate::c_types::CResultTempl::err( { 0u8 /*e*/ }) }; local_ret } #[must_use] -extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment_htlc_transactions(this_arg: *const c_void, local_commitment_tx: &crate::ln::chan_utils::HolderCommitmentTransaction) -> crate::c_types::derived::CResult_CVec_SignatureZNoneZ { - let mut ret = unsafe { &mut *(this_arg as *mut nativeInMemoryChannelKeys) }.sign_holder_commitment_htlc_transactions(unsafe { &*local_commitment_tx.inner }, &bitcoin::secp256k1::Secp256k1::new()); +extern "C" fn InMemoryChannelKeys_ChannelKeys_sign_holder_commitment_htlc_transactions(this_arg: *const c_void, holder_commitment_tx: &crate::ln::chan_utils::HolderCommitmentTransaction) -> crate::c_types::derived::CResult_CVec_SignatureZNoneZ { + let mut ret = unsafe { &mut *(this_arg as *mut nativeInMemoryChannelKeys) }.sign_holder_commitment_htlc_transactions(unsafe { &*holder_commitment_tx.inner }, &bitcoin::secp256k1::Secp256k1::new()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { let mut local_ret_0 = Vec::new(); for item in o.drain(..) { local_ret_0.push( { let mut local_ret_0_0 = if item.is_none() { crate::c_types::Signature::null() } else { { crate::c_types::Signature::from_rust(&(item.unwrap())) } }; local_ret_0_0 }); }; local_ret_0.into() }), Err(mut e) => crate::c_types::CResultTempl::err( { 0u8 /*e*/ }) }; local_ret } diff --git a/lightning-c-bindings/src/ln/chan_utils.rs b/lightning-c-bindings/src/ln/chan_utils.rs index d4f551b23..bf3953a09 100644 --- a/lightning-c-bindings/src/ln/chan_utils.rs +++ b/lightning-c-bindings/src/ln/chan_utils.rs @@ -40,11 +40,16 @@ pub extern "C" fn derive_public_key(per_commitment_point: crate::c_types::Public /// Derives a per-commitment-transaction revocation key from its constituent parts. /// +/// Only the cheating participant owns a valid witness to propagate a revoked +/// commitment transaction, thus per_commitment_secret always come from cheater +/// and revocation_base_secret always come from punisher, which is the broadcaster +/// of the transaction spending with this key knowledge. +/// /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { - let mut ret = lightning::ln::chan_utils::derive_private_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *per_commitment_secret}[..]).unwrap(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *revocation_base_secret}[..]).unwrap()); +pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u8; 32], countersignatory_revocation_base_secret: *const [u8; 32]) -> crate::c_types::derived::CResult_SecretKeySecpErrorZ { + let mut ret = lightning::ln::chan_utils::derive_private_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *per_commitment_secret}[..]).unwrap(), &::bitcoin::secp256k1::key::SecretKey::from_slice(&unsafe { *countersignatory_revocation_base_secret}[..]).unwrap()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::SecretKey::from_rust(o) }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }) }; local_ret } @@ -53,11 +58,16 @@ pub extern "C" fn derive_private_revocation_key(per_commitment_secret: *const [u /// the public equivalend of derive_private_revocation_key - using only public keys to derive a /// public key instead of private keys. /// +/// Only the cheating participant owns a valid witness to propagate a revoked +/// commitment transaction, thus per_commitment_point always come from cheater +/// and revocation_base_point always come from punisher, which is the broadcaster +/// of the transaction spending with this key knowledge. +/// /// Note that this is infallible iff we trust that at least one of the two input keys are randomly /// generated (ie our own). #[no_mangle] -pub extern "C" fn derive_public_revocation_key(per_commitment_point: crate::c_types::PublicKey, revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { - let mut ret = lightning::ln::chan_utils::derive_public_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &revocation_base_point.into_rust()); +pub extern "C" fn derive_public_revocation_key(per_commitment_point: crate::c_types::PublicKey, countersignatory_revocation_base_point: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_PublicKeySecpErrorZ { + let mut ret = lightning::ln::chan_utils::derive_public_revocation_key(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &countersignatory_revocation_base_point.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::c_types::PublicKey::from_rust(&o) }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }) }; local_ret } @@ -69,6 +79,10 @@ type nativeTxCreationKeys = nativeTxCreationKeysImport; /// The set of public keys which are used in the creation of one commitment transaction. /// These are derived from the channel base keys and per-commitment data. /// +/// A broadcaster key is provided from potential broadcaster of the computed transaction. +/// A countersignatory key is coming from a protocol participant unable to broadcast the +/// transaction. +/// /// These keys are assumed to be good, either because the code derived them from /// channel basepoints via the new function, or they were obtained via /// PreCalculatedTxCreationKeys.trust_key_derivation because we trusted the source of the @@ -119,26 +133,28 @@ impl Clone for TxCreationKeys { 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 } -/// The per-commitment public key which was used to derive the other keys. +/// 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 { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.per_commitment_point; crate::c_types::PublicKey::from_rust(&(*inner_val)) } -/// The per-commitment public key which was used to derive the other keys. +/// The broadcaster's per-commitment public key which was used to derive the other keys. #[no_mangle] pub extern "C" fn TxCreationKeys_set_per_commitment_point(this_ptr: &mut TxCreationKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.per_commitment_point = val.into_rust(); } -/// The revocation key which is used to allow the owner of the commitment transaction to -/// provide their counterparty the ability to punish them if they broadcast an old state. +/// The revocation key which is used to allow the broadcaster of the commitment +/// transaction to provide their counterparty the ability to punish them if they broadcast +/// an old state. #[no_mangle] pub extern "C" fn TxCreationKeys_get_revocation_key(this_ptr: &TxCreationKeys) -> crate::c_types::PublicKey { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.revocation_key; crate::c_types::PublicKey::from_rust(&(*inner_val)) } -/// The revocation key which is used to allow the owner of the commitment transaction to -/// provide their counterparty the ability to punish them if they broadcast an old state. +/// The revocation key which is used to allow the broadcaster of the commitment +/// transaction to provide their counterparty the ability to punish them if they broadcast +/// an old state. #[no_mangle] pub extern "C" fn TxCreationKeys_set_revocation_key(this_ptr: &mut TxCreationKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.revocation_key = val.into_rust(); @@ -165,13 +181,13 @@ pub extern "C" fn TxCreationKeys_get_countersignatory_htlc_key(this_ptr: &TxCrea pub extern "C" fn TxCreationKeys_set_countersignatory_htlc_key(this_ptr: &mut TxCreationKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.countersignatory_htlc_key = val.into_rust(); } -/// Payment Key (which isn't allowed to be spent from for some delay) +/// Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) #[no_mangle] pub extern "C" fn TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr: &TxCreationKeys) -> crate::c_types::PublicKey { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.broadcaster_delayed_payment_key; crate::c_types::PublicKey::from_rust(&(*inner_val)) } -/// Payment Key (which isn't allowed to be spent from for some delay) +/// Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) #[no_mangle] pub extern "C" fn TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr: &mut TxCreationKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.broadcaster_delayed_payment_key = val.into_rust(); @@ -346,17 +362,17 @@ pub extern "C" fn ChannelPublicKeys_get_revocation_basepoint(this_ptr: &ChannelP pub extern "C" fn ChannelPublicKeys_set_revocation_basepoint(this_ptr: &mut ChannelPublicKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.revocation_basepoint = val.into_rust(); } -/// The public key which receives our immediately spendable primary channel balance in -/// counterparty-broadcasted commitment transactions. This key is static across every commitment -/// transaction. +/// The public key on which the non-broadcaster (ie the countersignatory) receives an immediately +/// spendable primary channel balance on the broadcaster's commitment transaction. This key is +/// static across every commitment transaction. #[no_mangle] pub extern "C" fn ChannelPublicKeys_get_payment_point(this_ptr: &ChannelPublicKeys) -> crate::c_types::PublicKey { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.payment_point; crate::c_types::PublicKey::from_rust(&(*inner_val)) } -/// The public key which receives our immediately spendable primary channel balance in -/// counterparty-broadcasted commitment transactions. This key is static across every commitment -/// transaction. +/// The public key on which the non-broadcaster (ie the countersignatory) receives an immediately +/// spendable primary channel balance on the broadcaster's commitment transaction. This key is +/// static across every commitment transaction. #[no_mangle] pub extern "C" fn ChannelPublicKeys_set_payment_point(this_ptr: &mut ChannelPublicKeys, mut val: crate::c_types::PublicKey) { unsafe { &mut *this_ptr.inner }.payment_point = val.into_rust(); @@ -415,18 +431,18 @@ pub extern "C" fn ChannelPublicKeys_read(ser: crate::c_types::u8slice) -> Channe /// Create a new TxCreationKeys from channel base points and the per-commitment point #[must_use] #[no_mangle] -pub extern "C" fn TxCreationKeys_derive_new(per_commitment_point: crate::c_types::PublicKey, a_delayed_payment_base: crate::c_types::PublicKey, a_htlc_base: crate::c_types::PublicKey, b_revocation_base: crate::c_types::PublicKey, b_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { - let mut ret = lightning::ln::chan_utils::TxCreationKeys::derive_new(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &a_delayed_payment_base.into_rust(), &a_htlc_base.into_rust(), &b_revocation_base.into_rust(), &b_htlc_base.into_rust()); +pub extern "C" fn TxCreationKeys_derive_new(per_commitment_point: crate::c_types::PublicKey, broadcaster_delayed_payment_base: crate::c_types::PublicKey, broadcaster_htlc_base: crate::c_types::PublicKey, countersignatory_revocation_base: crate::c_types::PublicKey, countersignatory_htlc_base: crate::c_types::PublicKey) -> crate::c_types::derived::CResult_TxCreationKeysSecpErrorZ { + let mut ret = lightning::ln::chan_utils::TxCreationKeys::derive_new(&bitcoin::secp256k1::Secp256k1::new(), &per_commitment_point.into_rust(), &broadcaster_delayed_payment_base.into_rust(), &broadcaster_htlc_base.into_rust(), &countersignatory_revocation_base.into_rust(), &countersignatory_htlc_base.into_rust()); let mut local_ret = match ret { Ok(mut o) => crate::c_types::CResultTempl::ok( { crate::ln::chan_utils::TxCreationKeys { inner: Box::into_raw(Box::new(o)), is_owned: true } }), Err(mut e) => crate::c_types::CResultTempl::err( { crate::c_types::Secp256k1Error::from_rust(e) }) }; local_ret } /// A script either spendable by the revocation /// key or the broadcaster_delayed_payment_key and satisfying the relative-locktime OP_CSV constrain. -/// Encumbering a `to_local` output on a commitment transaction or 2nd-stage HTLC transactions. +/// Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions. #[no_mangle] -pub extern "C" fn get_revokeable_redeemscript(revocation_key: crate::c_types::PublicKey, mut to_self_delay: u16, broadcaster_delayed_payment_key: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { - let mut ret = lightning::ln::chan_utils::get_revokeable_redeemscript(&revocation_key.into_rust(), to_self_delay, &broadcaster_delayed_payment_key.into_rust()); +pub extern "C" fn get_revokeable_redeemscript(revocation_key: crate::c_types::PublicKey, mut contest_delay: u16, broadcaster_delayed_payment_key: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { + let mut ret = lightning::ln::chan_utils::get_revokeable_redeemscript(&revocation_key.into_rust(), contest_delay, &broadcaster_delayed_payment_key.into_rust()); ret.into_bytes().into() } @@ -545,8 +561,8 @@ pub extern "C" fn HTLCOutputInCommitment_read(ser: crate::c_types::u8slice) -> H HTLCOutputInCommitment { inner: std::ptr::null_mut(), is_owned: true } } } -/// note here that 'a_revocation_key' is generated using b_revocation_basepoint and a's -/// commitment secret. 'htlc' does *not* need to have its previous_output_index filled. +/// Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc +/// does not need to have its previous_output_index filled. #[no_mangle] pub extern "C" fn get_htlc_redeemscript(htlc: &crate::ln::chan_utils::HTLCOutputInCommitment, keys: &crate::ln::chan_utils::TxCreationKeys) -> crate::c_types::derived::CVec_u8Z { let mut ret = lightning::ln::chan_utils::get_htlc_redeemscript(unsafe { &*htlc.inner }, unsafe { &*keys.inner }); @@ -556,15 +572,15 @@ pub extern "C" fn get_htlc_redeemscript(htlc: &crate::ln::chan_utils::HTLCOutput /// Gets the redeemscript for a funding output from the two funding public keys. /// Note that the order of funding public keys does not matter. #[no_mangle] -pub extern "C" fn make_funding_redeemscript(a: crate::c_types::PublicKey, b: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { - let mut ret = lightning::ln::chan_utils::make_funding_redeemscript(&a.into_rust(), &b.into_rust()); +pub extern "C" fn make_funding_redeemscript(broadcaster: crate::c_types::PublicKey, countersignatory: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { + let mut ret = lightning::ln::chan_utils::make_funding_redeemscript(&broadcaster.into_rust(), &countersignatory.into_rust()); ret.into_bytes().into() } /// panics if htlc.transaction_output_index.is_none()! #[no_mangle] -pub extern "C" fn build_htlc_transaction(prev_hash: *const [u8; 32], mut feerate_per_kw: u32, mut to_self_delay: u16, htlc: &crate::ln::chan_utils::HTLCOutputInCommitment, broadcaster_delayed_payment_key: crate::c_types::PublicKey, revocation_key: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { - let mut ret = lightning::ln::chan_utils::build_htlc_transaction(&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*prev_hash }[..]).unwrap(), feerate_per_kw, to_self_delay, unsafe { &*htlc.inner }, &broadcaster_delayed_payment_key.into_rust(), &revocation_key.into_rust()); +pub extern "C" fn build_htlc_transaction(prev_hash: *const [u8; 32], mut feerate_per_kw: u32, mut contest_delay: u16, htlc: &crate::ln::chan_utils::HTLCOutputInCommitment, broadcaster_delayed_payment_key: crate::c_types::PublicKey, revocation_key: crate::c_types::PublicKey) -> crate::c_types::derived::CVec_u8Z { + let mut ret = lightning::ln::chan_utils::build_htlc_transaction(&::bitcoin::hash_types::Txid::from_slice(&unsafe { &*prev_hash }[..]).unwrap(), feerate_per_kw, contest_delay, unsafe { &*htlc.inner }, &broadcaster_delayed_payment_key.into_rust(), &revocation_key.into_rust()); let mut local_ret = ::bitcoin::consensus::encode::serialize(&ret); local_ret.into() } @@ -662,7 +678,7 @@ pub extern "C" fn HolderCommitmentTransaction_set_feerate_per_kw(this_ptr: &mut /// /// Note that this includes all HTLCs, including ones which were considered dust and not /// actually included in the transaction as it appears on-chain, but who's value is burned as -/// fees and not included in the to_local or to_remote outputs. +/// fees and not included in the to_holder or to_counterparty outputs. /// /// The counterparty HTLC signatures in the second element will always be set for non-dust HTLCs, ie /// those for which transaction_output_index.is_some(). @@ -679,8 +695,8 @@ pub extern "C" fn HolderCommitmentTransaction_set_per_htlc(this_ptr: &mut Holder #[must_use] #[no_mangle] pub extern "C" fn HolderCommitmentTransaction_new_missing_holder_sig(mut unsigned_tx: crate::c_types::derived::CVec_u8Z, mut counterparty_sig: crate::c_types::Signature, holder_funding_key: crate::c_types::PublicKey, counterparty_funding_key: crate::c_types::PublicKey, mut keys: crate::ln::chan_utils::TxCreationKeys, mut feerate_per_kw: u32, mut htlc_data: crate::c_types::derived::CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ) -> crate::ln::chan_utils::HolderCommitmentTransaction { - let mut holder_htlc_data = Vec::new(); for mut item in htlc_data.into_rust().drain(..) { holder_htlc_data.push( { let (mut orig_htlc_data_0_0, mut orig_htlc_data_0_1) = item.to_rust(); let mut holder_orig_htlc_data_0_1 = if orig_htlc_data_0_1.is_null() { None } else { Some( { orig_htlc_data_0_1.into_rust() }) }; let mut holder_htlc_data_0 = (*unsafe { Box::from_raw(orig_htlc_data_0_0.take_ptr()) }, holder_orig_htlc_data_0_1); holder_htlc_data_0 }); }; - let mut ret = lightning::ln::chan_utils::HolderCommitmentTransaction::new_missing_holder_sig(::bitcoin::consensus::encode::deserialize(&unsigned_tx.into_rust()[..]).unwrap(), counterparty_sig.into_rust(), &holder_funding_key.into_rust(), &counterparty_funding_key.into_rust(), *unsafe { Box::from_raw(keys.take_ptr()) }, feerate_per_kw, holder_htlc_data); + let mut local_htlc_data = Vec::new(); for mut item in htlc_data.into_rust().drain(..) { local_htlc_data.push( { let (mut orig_htlc_data_0_0, mut orig_htlc_data_0_1) = item.to_rust(); let mut local_orig_htlc_data_0_1 = if orig_htlc_data_0_1.is_null() { None } else { Some( { orig_htlc_data_0_1.into_rust() }) }; let mut local_htlc_data_0 = (*unsafe { Box::from_raw(orig_htlc_data_0_0.take_ptr()) }, local_orig_htlc_data_0_1); local_htlc_data_0 }); }; + let mut ret = lightning::ln::chan_utils::HolderCommitmentTransaction::new_missing_holder_sig(::bitcoin::consensus::encode::deserialize(&unsigned_tx.into_rust()[..]).unwrap(), counterparty_sig.into_rust(), &holder_funding_key.into_rust(), &counterparty_funding_key.into_rust(), *unsafe { Box::from_raw(keys.take_ptr()) }, feerate_per_kw, local_htlc_data); crate::ln::chan_utils::HolderCommitmentTransaction { inner: Box::into_raw(Box::new(ret)), is_owned: true } } @@ -702,7 +718,7 @@ pub extern "C" fn HolderCommitmentTransaction_txid(this_arg: &HolderCommitmentTr crate::c_types::ThirtyTwoBytes { data: ret.into_inner() } } -/// Gets our signature for the contained commitment transaction given our funding private key. +/// Gets holder signature for the contained commitment transaction given holder funding private key. /// /// Funding key is your key included in the 2-2 funding_outpoint lock. Should be provided /// by your ChannelKeys. diff --git a/lightning-c-bindings/src/ln/channelmanager.rs b/lightning-c-bindings/src/ln/channelmanager.rs index 43e38b357..c71305904 100644 --- a/lightning-c-bindings/src/ln/channelmanager.rs +++ b/lightning-c-bindings/src/ln/channelmanager.rs @@ -624,62 +624,62 @@ pub extern "C" fn ChannelManager_as_ChannelMessageHandler(this_arg: *const Chann } } use lightning::ln::msgs::ChannelMessageHandler as ChannelMessageHandlerTraitImport; -extern "C" fn ChannelManager_ChannelMessageHandler_handle_open_channel(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, mut their_features: crate::ln::features::InitFeatures, msg: &crate::ln::msgs::OpenChannel) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_open_channel(&their_node_id.into_rust(), *unsafe { Box::from_raw(their_features.take_ptr()) }, unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_open_channel(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, mut their_features: crate::ln::features::InitFeatures, msg: &crate::ln::msgs::OpenChannel) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_open_channel(&counterparty_node_id.into_rust(), *unsafe { Box::from_raw(their_features.take_ptr()) }, unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_accept_channel(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, mut their_features: crate::ln::features::InitFeatures, msg: &crate::ln::msgs::AcceptChannel) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_accept_channel(&their_node_id.into_rust(), *unsafe { Box::from_raw(their_features.take_ptr()) }, unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_accept_channel(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, mut their_features: crate::ln::features::InitFeatures, msg: &crate::ln::msgs::AcceptChannel) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_accept_channel(&counterparty_node_id.into_rust(), *unsafe { Box::from_raw(their_features.take_ptr()) }, unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_created(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingCreated) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_created(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_created(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingCreated) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_created(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_signed(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingSigned) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_signed(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_signed(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingSigned) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_signed(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_locked(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingLocked) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_locked(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_funding_locked(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingLocked) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_funding_locked(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_shutdown(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::Shutdown) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_shutdown(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_shutdown(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::Shutdown) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_shutdown(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_closing_signed(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ClosingSigned) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_closing_signed(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_closing_signed(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ClosingSigned) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_closing_signed(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_add_htlc(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateAddHTLC) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_add_htlc(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_add_htlc(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateAddHTLC) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_add_htlc(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fulfill_htlc(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFulfillHTLC) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fulfill_htlc(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fulfill_htlc(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFulfillHTLC) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fulfill_htlc(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fail_htlc(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFailHTLC) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fail_htlc(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fail_htlc(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFailHTLC) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fail_htlc(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFailMalformedHTLC) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fail_malformed_htlc(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fail_malformed_htlc(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFailMalformedHTLC) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fail_malformed_htlc(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_commitment_signed(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::CommitmentSigned) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_commitment_signed(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_commitment_signed(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::CommitmentSigned) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_commitment_signed(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_revoke_and_ack(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::RevokeAndACK) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_revoke_and_ack(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_revoke_and_ack(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::RevokeAndACK) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_revoke_and_ack(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fee(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFee) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fee(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_update_fee(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::UpdateFee) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_update_fee(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_announcement_signatures(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::AnnouncementSignatures) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_announcement_signatures(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_announcement_signatures(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::AnnouncementSignatures) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_announcement_signatures(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_channel_reestablish(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_channel_reestablish(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_channel_reestablish(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ChannelReestablish) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_channel_reestablish(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_peer_disconnected(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, mut no_connection_possible: bool) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.peer_disconnected(&their_node_id.into_rust(), no_connection_possible) +extern "C" fn ChannelManager_ChannelMessageHandler_peer_disconnected(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, mut no_connection_possible: bool) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.peer_disconnected(&counterparty_node_id.into_rust(), no_connection_possible) } -extern "C" fn ChannelManager_ChannelMessageHandler_peer_connected(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, init_msg: &crate::ln::msgs::Init) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.peer_connected(&their_node_id.into_rust(), unsafe { &*init_msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_peer_connected(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, init_msg: &crate::ln::msgs::Init) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.peer_connected(&counterparty_node_id.into_rust(), unsafe { &*init_msg.inner }) } -extern "C" fn ChannelManager_ChannelMessageHandler_handle_error(this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage) { - unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_error(&their_node_id.into_rust(), unsafe { &*msg.inner }) +extern "C" fn ChannelManager_ChannelMessageHandler_handle_error(this_arg: *const c_void, counterparty_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ErrorMessage) { + unsafe { &mut *(this_arg as *mut nativeChannelManager) }.handle_error(&counterparty_node_id.into_rust(), unsafe { &*msg.inner }) } use lightning::util::events::MessageSendEventsProvider as nativeMessageSendEventsProviderTrait; #[must_use] diff --git a/lightning-c-bindings/src/ln/channelmonitor.rs b/lightning-c-bindings/src/ln/channelmonitor.rs index c53d7197a..671566af3 100644 --- a/lightning-c-bindings/src/ln/channelmonitor.rs +++ b/lightning-c-bindings/src/ln/channelmonitor.rs @@ -111,7 +111,7 @@ pub enum ChannelMonitorUpdateErr { /// our state failed, but is expected to succeed at some point in the future). /// /// Such a failure will \"freeze\" a channel, preventing us from revoking old states or - /// submitting new commitment transactions to the remote party. Once the update(s) which failed + /// submitting new commitment transactions to the counterparty. Once the update(s) which failed /// have been successfully applied, ChannelManager::channel_monitor_updated can be used to /// restore the channel to an operational state. /// @@ -144,11 +144,19 @@ pub enum ChannelMonitorUpdateErr { TemporaryFailure, /// Used to indicate no further channel monitor updates will be allowed (eg we've moved on to a /// different watchtower and cannot update with all watchtowers that were previously informed - /// of this channel). This will force-close the channel in question (which will generate one - /// final ChannelMonitorUpdate which must be delivered to at least one ChannelMonitor copy). + /// of this channel). /// - /// Should also be used to indicate a failure to update the local persisted copy of the channel - /// monitor. + /// At reception of this error, ChannelManager will force-close the channel and return at + /// least a final ChannelMonitorUpdate::ChannelForceClosed which must be delivered to at + /// least one ChannelMonitor copy. Revocation secret MUST NOT be released and offchain channel + /// update must be rejected. + /// + /// This failure may also signal a failure to update the local persisted copy of one of + /// the channel monitor instance. + /// + /// Note that even when you fail a holder commitment transaction update, you must store the + /// update to ensure you can claim from it in case of a duplicate copy of this ChannelMonitor + /// broadcasts it (e.g distributed channel-monitor deployment) PermanentFailure, } use lightning::ln::channelmonitor::ChannelMonitorUpdateErr as nativeChannelMonitorUpdateErr; @@ -424,6 +432,11 @@ pub struct ManyChannelMonitor { /// /// Any spends of outputs which should have been registered which aren't passed to /// ChannelMonitors via block_connected may result in FUNDS LOSS. + /// + /// In case of distributed watchtowers deployment, even if an Err is return, the new version + /// must be written to disk, as state may have been stored but rejected due to a block forcing + /// a commitment broadcast. This storage is used to claim outputs of rejected state confirmed + /// onchain by another watchtower, lagging behind on block processing. #[must_use] pub update_monitor: extern "C" fn (this_arg: *const c_void, funding_txo: crate::chain::transaction::OutPoint, monitor: crate::ln::channelmonitor::ChannelMonitorUpdate) -> crate::c_types::derived::CResult_NoneChannelMonitorUpdateErrZ, /// Used by ChannelManager to get list of HTLC resolved onchain and which needed to be updated @@ -531,12 +544,12 @@ pub extern "C" fn ChannelMonitor_get_and_clear_pending_events(this_arg: &mut Cha local_ret.into() } -/// Used by ChannelManager deserialization to broadcast the latest local state if its copy of -/// the Channel was out-of-date. You may use it to get a broadcastable local toxic tx in case of -/// fallen-behind, i.e when receiving a channel_reestablish with a proof that our remote side knows -/// a higher revocation secret than the local commitment number we are aware of. Broadcasting these -/// transactions are UNSAFE, as they allow remote side to punish you. Nevertheless you may want to -/// broadcast them if remote don't close channel with his higher commitment transaction after a +/// Used by ChannelManager deserialization to broadcast the latest holder state if its copy of +/// the Channel was out-of-date. You may use it to get a broadcastable holder toxic tx in case of +/// fallen-behind, i.e when receiving a channel_reestablish with a proof that our counterparty side knows +/// a higher revocation secret than the holder commitment number we are aware of. Broadcasting these +/// transactions are UNSAFE, as they allow counterparty side to punish you. Nevertheless you may want to +/// broadcast them if counterparty don't close channel with his higher commitment transaction after a /// substantial amount of time (a month or even a year) to get back funds. Best may be to contact /// out-of-band the other node operator to coordinate with him if option is available to you. /// In any-case, choice is up to the user. diff --git a/lightning-c-bindings/src/ln/msgs.rs b/lightning-c-bindings/src/ln/msgs.rs index 6726b9521..e3ca0944a 100644 --- a/lightning-c-bindings/src/ln/msgs.rs +++ b/lightning-c-bindings/src/ln/msgs.rs @@ -2920,6 +2920,488 @@ pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature contents: *unsafe { Box::from_raw(contents_arg.take_ptr()) }, })), is_owned: true } } + +use lightning::ln::msgs::QueryChannelRange as nativeQueryChannelRangeImport; +type nativeQueryChannelRange = nativeQueryChannelRangeImport; + +/// A query_channel_range message is used to query a peer for channel +/// UTXOs in a range of blocks. The recipient of a query makes a best +/// effort to reply to the query using one or more reply_channel_range +/// messages. +#[must_use] +#[repr(C)] +pub struct QueryChannelRange { + /// Nearly everyhwere, inner must be non-null, however in places where + /// the Rust equivalent takes an Option, it may be set to null to indicate None. + pub inner: *mut nativeQueryChannelRange, + pub is_owned: bool, +} + +impl Drop for QueryChannelRange { + fn drop(&mut self) { + if self.is_owned && !self.inner.is_null() { + let _ = unsafe { Box::from_raw(self.inner) }; + } + } +} +#[no_mangle] +pub extern "C" fn QueryChannelRange_free(this_ptr: QueryChannelRange) { } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +extern "C" fn QueryChannelRange_free_void(this_ptr: *mut c_void) { + unsafe { let _ = Box::from_raw(this_ptr as *mut nativeQueryChannelRange); } +} +#[allow(unused)] +/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy +impl QueryChannelRange { + pub(crate) fn take_ptr(mut self) -> *mut nativeQueryChannelRange { + assert!(self.is_owned); + let ret = self.inner; + self.inner = std::ptr::null_mut(); + ret + } +} +impl Clone for QueryChannelRange { + 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 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 +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn QueryChannelRange_get_chain_hash(this_ptr: &QueryChannelRange) -> *const [u8; 32] { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash; + (*inner_val).as_inner() +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn QueryChannelRange_set_chain_hash(this_ptr: &mut QueryChannelRange, mut val: crate::c_types::ThirtyTwoBytes) { + unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap(); +} +/// The height of the first block for the channel UTXOs being queried +#[no_mangle] +pub extern "C" fn QueryChannelRange_get_first_blocknum(this_ptr: &QueryChannelRange) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum; + (*inner_val) +} +/// The height of the first block for the channel UTXOs being queried +#[no_mangle] +pub extern "C" fn QueryChannelRange_set_first_blocknum(this_ptr: &mut QueryChannelRange, mut val: u32) { + unsafe { &mut *this_ptr.inner }.first_blocknum = val; +} +/// The number of blocks to include in the query results +#[no_mangle] +pub extern "C" fn QueryChannelRange_get_number_of_blocks(this_ptr: &QueryChannelRange) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks; + (*inner_val) +} +/// The number of blocks to include in the query results +#[no_mangle] +pub extern "C" fn QueryChannelRange_set_number_of_blocks(this_ptr: &mut QueryChannelRange, mut val: u32) { + unsafe { &mut *this_ptr.inner }.number_of_blocks = val; +} +#[must_use] +#[no_mangle] +pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32) -> QueryChannelRange { + QueryChannelRange { inner: Box::into_raw(Box::new(nativeQueryChannelRange { + chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(), + first_blocknum: first_blocknum_arg, + number_of_blocks: number_of_blocks_arg, + })), is_owned: true } +} + +use lightning::ln::msgs::ReplyChannelRange as nativeReplyChannelRangeImport; +type nativeReplyChannelRange = nativeReplyChannelRangeImport; + +/// A reply_channel_range message is a reply to a query_channel_range +/// message. Multiple reply_channel_range messages can be sent in reply +/// to a single query_channel_range message. The query recipient makes a +/// best effort to respond based on their local network view which may +/// not be a perfect view of the network. The short_channel_ids in the +/// reply are encoded. We only support encoding_type=0 uncompressed +/// serialization and do not support encoding_type=1 zlib serialization. +#[must_use] +#[repr(C)] +pub struct ReplyChannelRange { + /// Nearly everyhwere, inner must be non-null, however in places where + /// the Rust equivalent takes an Option, it may be set to null to indicate None. + pub inner: *mut nativeReplyChannelRange, + pub is_owned: bool, +} + +impl Drop for ReplyChannelRange { + fn drop(&mut self) { + if self.is_owned && !self.inner.is_null() { + let _ = unsafe { Box::from_raw(self.inner) }; + } + } +} +#[no_mangle] +pub extern "C" fn ReplyChannelRange_free(this_ptr: ReplyChannelRange) { } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +extern "C" fn ReplyChannelRange_free_void(this_ptr: *mut c_void) { + unsafe { let _ = Box::from_raw(this_ptr as *mut nativeReplyChannelRange); } +} +#[allow(unused)] +/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy +impl ReplyChannelRange { + pub(crate) fn take_ptr(mut self) -> *mut nativeReplyChannelRange { + assert!(self.is_owned); + let ret = self.inner; + self.inner = std::ptr::null_mut(); + ret + } +} +impl Clone for ReplyChannelRange { + 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 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 +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn ReplyChannelRange_get_chain_hash(this_ptr: &ReplyChannelRange) -> *const [u8; 32] { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash; + (*inner_val).as_inner() +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn ReplyChannelRange_set_chain_hash(this_ptr: &mut ReplyChannelRange, mut val: crate::c_types::ThirtyTwoBytes) { + unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap(); +} +/// The height of the first block in the range of the reply +#[no_mangle] +pub extern "C" fn ReplyChannelRange_get_first_blocknum(this_ptr: &ReplyChannelRange) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_blocknum; + (*inner_val) +} +/// The height of the first block in the range of the reply +#[no_mangle] +pub extern "C" fn ReplyChannelRange_set_first_blocknum(this_ptr: &mut ReplyChannelRange, mut val: u32) { + unsafe { &mut *this_ptr.inner }.first_blocknum = val; +} +/// The number of blocks included in the range of the reply +#[no_mangle] +pub extern "C" fn ReplyChannelRange_get_number_of_blocks(this_ptr: &ReplyChannelRange) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.number_of_blocks; + (*inner_val) +} +/// The number of blocks included in the range of the reply +#[no_mangle] +pub extern "C" fn ReplyChannelRange_set_number_of_blocks(this_ptr: &mut ReplyChannelRange, mut val: u32) { + unsafe { &mut *this_ptr.inner }.number_of_blocks = val; +} +/// Indicates if the query recipient maintains up-to-date channel +/// information for the chain_hash +#[no_mangle] +pub extern "C" fn ReplyChannelRange_get_full_information(this_ptr: &ReplyChannelRange) -> bool { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.full_information; + (*inner_val) +} +/// Indicates if the query recipient maintains up-to-date channel +/// information for the chain_hash +#[no_mangle] +pub extern "C" fn ReplyChannelRange_set_full_information(this_ptr: &mut ReplyChannelRange, mut val: bool) { + unsafe { &mut *this_ptr.inner }.full_information = val; +} +/// The short_channel_ids in the channel range +#[no_mangle] +pub extern "C" fn ReplyChannelRange_set_short_channel_ids(this_ptr: &mut ReplyChannelRange, mut val: crate::c_types::derived::CVec_u64Z) { + let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); }; + unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val; +} +#[must_use] +#[no_mangle] +pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_blocknum_arg: u32, mut number_of_blocks_arg: u32, mut full_information_arg: bool, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> ReplyChannelRange { + let mut local_short_channel_ids_arg = Vec::new(); for mut item in short_channel_ids_arg.into_rust().drain(..) { local_short_channel_ids_arg.push( { item }); }; + ReplyChannelRange { inner: Box::into_raw(Box::new(nativeReplyChannelRange { + chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(), + first_blocknum: first_blocknum_arg, + number_of_blocks: number_of_blocks_arg, + full_information: full_information_arg, + short_channel_ids: local_short_channel_ids_arg, + })), is_owned: true } +} + +use lightning::ln::msgs::QueryShortChannelIds as nativeQueryShortChannelIdsImport; +type nativeQueryShortChannelIds = nativeQueryShortChannelIdsImport; + +/// A query_short_channel_ids message is used to query a peer for +/// routing gossip messages related to one or more short_channel_ids. +/// The query recipient will reply with the latest, if available, +/// channel_announcement, channel_update and node_announcement messages +/// it maintains for the requested short_channel_ids followed by a +/// reply_short_channel_ids_end message. The short_channel_ids sent in +/// this query are encoded. We only support encoding_type=0 uncompressed +/// serialization and do not support encoding_type=1 zlib serialization. +#[must_use] +#[repr(C)] +pub struct QueryShortChannelIds { + /// Nearly everyhwere, inner must be non-null, however in places where + /// the Rust equivalent takes an Option, it may be set to null to indicate None. + pub inner: *mut nativeQueryShortChannelIds, + pub is_owned: bool, +} + +impl Drop for QueryShortChannelIds { + fn drop(&mut self) { + if self.is_owned && !self.inner.is_null() { + let _ = unsafe { Box::from_raw(self.inner) }; + } + } +} +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_free(this_ptr: QueryShortChannelIds) { } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +extern "C" fn QueryShortChannelIds_free_void(this_ptr: *mut c_void) { + unsafe { let _ = Box::from_raw(this_ptr as *mut nativeQueryShortChannelIds); } +} +#[allow(unused)] +/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy +impl QueryShortChannelIds { + pub(crate) fn take_ptr(mut self) -> *mut nativeQueryShortChannelIds { + assert!(self.is_owned); + let ret = self.inner; + self.inner = std::ptr::null_mut(); + ret + } +} +impl Clone for QueryShortChannelIds { + 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 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 +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_get_chain_hash(this_ptr: &QueryShortChannelIds) -> *const [u8; 32] { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash; + (*inner_val).as_inner() +} +/// The genesis hash of the blockchain being queried +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_set_chain_hash(this_ptr: &mut QueryShortChannelIds, mut val: crate::c_types::ThirtyTwoBytes) { + unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap(); +} +/// The short_channel_ids that are being queried +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_set_short_channel_ids(this_ptr: &mut QueryShortChannelIds, mut val: crate::c_types::derived::CVec_u64Z) { + let mut local_val = Vec::new(); for mut item in val.into_rust().drain(..) { local_val.push( { item }); }; + unsafe { &mut *this_ptr.inner }.short_channel_ids = local_val; +} +#[must_use] +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut short_channel_ids_arg: crate::c_types::derived::CVec_u64Z) -> QueryShortChannelIds { + let mut local_short_channel_ids_arg = Vec::new(); for mut item in short_channel_ids_arg.into_rust().drain(..) { local_short_channel_ids_arg.push( { item }); }; + QueryShortChannelIds { inner: Box::into_raw(Box::new(nativeQueryShortChannelIds { + chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(), + short_channel_ids: local_short_channel_ids_arg, + })), is_owned: true } +} + +use lightning::ln::msgs::ReplyShortChannelIdsEnd as nativeReplyShortChannelIdsEndImport; +type nativeReplyShortChannelIdsEnd = nativeReplyShortChannelIdsEndImport; + +/// A reply_short_channel_ids_end message is sent as a reply to a +/// query_short_channel_ids message. The query recipient makes a best +/// effort to respond based on their local network view which may not be +/// a perfect view of the network. +#[must_use] +#[repr(C)] +pub struct ReplyShortChannelIdsEnd { + /// Nearly everyhwere, inner must be non-null, however in places where + /// the Rust equivalent takes an Option, it may be set to null to indicate None. + pub inner: *mut nativeReplyShortChannelIdsEnd, + pub is_owned: bool, +} + +impl Drop for ReplyShortChannelIdsEnd { + fn drop(&mut self) { + if self.is_owned && !self.inner.is_null() { + let _ = unsafe { Box::from_raw(self.inner) }; + } + } +} +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_free(this_ptr: ReplyShortChannelIdsEnd) { } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +extern "C" fn ReplyShortChannelIdsEnd_free_void(this_ptr: *mut c_void) { + unsafe { let _ = Box::from_raw(this_ptr as *mut nativeReplyShortChannelIdsEnd); } +} +#[allow(unused)] +/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy +impl ReplyShortChannelIdsEnd { + pub(crate) fn take_ptr(mut self) -> *mut nativeReplyShortChannelIdsEnd { + assert!(self.is_owned); + let ret = self.inner; + self.inner = std::ptr::null_mut(); + ret + } +} +impl Clone for ReplyShortChannelIdsEnd { + 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 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 +} +/// 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] { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash; + (*inner_val).as_inner() +} +/// The genesis hash of the blockchain that was queried +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_set_chain_hash(this_ptr: &mut ReplyShortChannelIdsEnd, mut val: crate::c_types::ThirtyTwoBytes) { + unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap(); +} +/// Indicates if the query recipient maintains up-to-date channel +/// information for the chain_hash +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_get_full_information(this_ptr: &ReplyShortChannelIdsEnd) -> bool { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.full_information; + (*inner_val) +} +/// Indicates if the query recipient maintains up-to-date channel +/// information for the chain_hash +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_set_full_information(this_ptr: &mut ReplyShortChannelIdsEnd, mut val: bool) { + unsafe { &mut *this_ptr.inner }.full_information = val; +} +#[must_use] +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut full_information_arg: bool) -> ReplyShortChannelIdsEnd { + ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(nativeReplyShortChannelIdsEnd { + chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(), + full_information: full_information_arg, + })), is_owned: true } +} + +use lightning::ln::msgs::GossipTimestampFilter as nativeGossipTimestampFilterImport; +type nativeGossipTimestampFilter = nativeGossipTimestampFilterImport; + +/// A gossip_timestamp_filter message is used by a node to request +/// gossip relay for messages in the requested time range when the +/// gossip_queries feature has been negotiated. +#[must_use] +#[repr(C)] +pub struct GossipTimestampFilter { + /// Nearly everyhwere, inner must be non-null, however in places where + /// the Rust equivalent takes an Option, it may be set to null to indicate None. + pub inner: *mut nativeGossipTimestampFilter, + pub is_owned: bool, +} + +impl Drop for GossipTimestampFilter { + fn drop(&mut self) { + if self.is_owned && !self.inner.is_null() { + let _ = unsafe { Box::from_raw(self.inner) }; + } + } +} +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_free(this_ptr: GossipTimestampFilter) { } +#[allow(unused)] +/// Used only if an object of this type is returned as a trait impl by a method +extern "C" fn GossipTimestampFilter_free_void(this_ptr: *mut c_void) { + unsafe { let _ = Box::from_raw(this_ptr as *mut nativeGossipTimestampFilter); } +} +#[allow(unused)] +/// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy +impl GossipTimestampFilter { + pub(crate) fn take_ptr(mut self) -> *mut nativeGossipTimestampFilter { + assert!(self.is_owned); + let ret = self.inner; + self.inner = std::ptr::null_mut(); + ret + } +} +impl Clone for GossipTimestampFilter { + 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 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 +} +/// 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] { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.chain_hash; + (*inner_val).as_inner() +} +/// The genesis hash of the blockchain for channel and node information +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_set_chain_hash(this_ptr: &mut GossipTimestampFilter, mut val: crate::c_types::ThirtyTwoBytes) { + unsafe { &mut *this_ptr.inner }.chain_hash = ::bitcoin::hash_types::BlockHash::from_slice(&val.data[..]).unwrap(); +} +/// The starting unix timestamp +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_get_first_timestamp(this_ptr: &GossipTimestampFilter) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.first_timestamp; + (*inner_val) +} +/// The starting unix timestamp +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_set_first_timestamp(this_ptr: &mut GossipTimestampFilter, mut val: u32) { + unsafe { &mut *this_ptr.inner }.first_timestamp = val; +} +/// The range of information in seconds +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_get_timestamp_range(this_ptr: &GossipTimestampFilter) -> u32 { + let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.timestamp_range; + (*inner_val) +} +/// The range of information in seconds +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_set_timestamp_range(this_ptr: &mut GossipTimestampFilter, mut val: u32) { + unsafe { &mut *this_ptr.inner }.timestamp_range = val; +} +#[must_use] +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types::ThirtyTwoBytes, mut first_timestamp_arg: u32, mut timestamp_range_arg: u32) -> GossipTimestampFilter { + GossipTimestampFilter { inner: Box::into_raw(Box::new(nativeGossipTimestampFilter { + chain_hash: ::bitcoin::hash_types::BlockHash::from_slice(&chain_hash_arg.data[..]).unwrap(), + first_timestamp: first_timestamp_arg, + timestamp_range: timestamp_range_arg, + })), is_owned: true } +} /// Used to put an error message in a LightningError #[must_use] #[derive(Clone)] @@ -3865,3 +4347,63 @@ pub extern "C" fn NodeAnnouncement_read(ser: crate::c_types::u8slice) -> NodeAnn NodeAnnouncement { inner: std::ptr::null_mut(), is_owned: true } } } +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_read(ser: crate::c_types::u8slice) -> QueryShortChannelIds { + if let Ok(res) = crate::c_types::deserialize_obj(ser) { + QueryShortChannelIds { inner: Box::into_raw(Box::new(res)), is_owned: true } + } else { + QueryShortChannelIds { inner: std::ptr::null_mut(), is_owned: true } + } +} +#[no_mangle] +pub extern "C" fn QueryShortChannelIds_write(obj: *const QueryShortChannelIds) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) +} +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_read(ser: crate::c_types::u8slice) -> ReplyShortChannelIdsEnd { + if let Ok(res) = crate::c_types::deserialize_obj(ser) { + ReplyShortChannelIdsEnd { inner: Box::into_raw(Box::new(res)), is_owned: true } + } else { + ReplyShortChannelIdsEnd { inner: std::ptr::null_mut(), is_owned: true } + } +} +#[no_mangle] +pub extern "C" fn ReplyShortChannelIdsEnd_write(obj: *const ReplyShortChannelIdsEnd) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) +} +#[no_mangle] +pub extern "C" fn QueryChannelRange_read(ser: crate::c_types::u8slice) -> QueryChannelRange { + if let Ok(res) = crate::c_types::deserialize_obj(ser) { + QueryChannelRange { inner: Box::into_raw(Box::new(res)), is_owned: true } + } else { + QueryChannelRange { inner: std::ptr::null_mut(), is_owned: true } + } +} +#[no_mangle] +pub extern "C" fn QueryChannelRange_write(obj: *const QueryChannelRange) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) +} +#[no_mangle] +pub extern "C" fn ReplyChannelRange_read(ser: crate::c_types::u8slice) -> ReplyChannelRange { + if let Ok(res) = crate::c_types::deserialize_obj(ser) { + ReplyChannelRange { inner: Box::into_raw(Box::new(res)), is_owned: true } + } else { + ReplyChannelRange { inner: std::ptr::null_mut(), is_owned: true } + } +} +#[no_mangle] +pub extern "C" fn ReplyChannelRange_write(obj: *const ReplyChannelRange) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) +} +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_read(ser: crate::c_types::u8slice) -> GossipTimestampFilter { + if let Ok(res) = crate::c_types::deserialize_obj(ser) { + GossipTimestampFilter { inner: Box::into_raw(Box::new(res)), is_owned: true } + } else { + GossipTimestampFilter { inner: std::ptr::null_mut(), is_owned: true } + } +} +#[no_mangle] +pub extern "C" fn GossipTimestampFilter_write(obj: *const GossipTimestampFilter) -> crate::c_types::derived::CVec_u8Z { + crate::c_types::serialize_obj(unsafe { &(*(*obj).inner) }) +}