- * - Dependent transactions within the same block must be given in topological order, possibly in
- * separate calls.
- * - Unconfirmed transactions must be given after the original confirmations and before any
- * reconfirmation.
- *
- * See individual method documentation for further details.
- *
- * [`transactions_confirmed`]: Self::transactions_confirmed
- * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
- * [`best_block_updated`]: Self::best_block_updated
- * [`get_relevant_txids`]: Self::get_relevant_txids
- */
-typedef struct LDKConfirm {
- /**
- * An opaque pointer which is passed to your function implementations as an argument.
- * This has no meaning in the LDK, and can be NULL or any other value.
- */
- void *this_arg;
- /**
- * Processes transactions confirmed in a block with a given header and height.
- *
- * Should be called for any transactions registered by [`Filter::register_tx`] or any
- * transactions spending an output registered by [`Filter::register_output`]. Such transactions
- * appearing in the same block do not need to be included in the same call; instead, multiple
- * calls with additional transactions may be made so long as they are made in [chain order].
- *
- * May be called before or after [`best_block_updated`] for the corresponding block. However,
- * in the event of a chain reorganization, it must not be called with a `header` that is no
- * longer in the chain as of the last call to [`best_block_updated`].
- *
- * [chain order]: Confirm#Order
- * [`best_block_updated`]: Self::best_block_updated
- */
- void (*transactions_confirmed)(const void *this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height);
- /**
- * Processes a transaction that is no longer confirmed as result of a chain reorganization.
- *
- * Should be called for any transaction returned by [`get_relevant_txids`] if it has been
- * reorganized out of the best chain. Once called, the given transaction should not be returned
- * by [`get_relevant_txids`] unless it has been reconfirmed via [`transactions_confirmed`].
- *
- * [`get_relevant_txids`]: Self::get_relevant_txids
- * [`transactions_confirmed`]: Self::transactions_confirmed
- */
- void (*transaction_unconfirmed)(const void *this_arg, const uint8_t (*txid)[32]);
- /**
- * Processes an update to the best header connected at the given height.
- *
- * Should be called when a new header is available but may be skipped for intermediary blocks
- * if they become available at the same time.
- */
- void (*best_block_updated)(const void *this_arg, const uint8_t (*header)[80], uint32_t height);
- /**
- * Returns transactions that should be monitored for reorganization out of the chain.
- *
- * Should include any transactions passed to [`transactions_confirmed`] that have insufficient
- * confirmations to be safe from a chain reorganization. Should not include any transactions
- * passed to [`transaction_unconfirmed`] unless later reconfirmed.
- *
- * May be called to determine the subset of transactions that must still be monitored for
- * reorganization. Will be idempotent between calls but may change as a result of calls to the
- * other interface methods. Thus, this is useful to determine which transactions may need to be
- * given to [`transaction_unconfirmed`].
- *
- * [`transactions_confirmed`]: Self::transactions_confirmed
- * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
- */
- struct LDKCVec_TxidZ (*get_relevant_txids)(const void *this_arg);
- /**
- * Frees any resources associated with this object given its this_arg pointer.
- * Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed.
- */
- void (*free)(void *this_arg);
-} LDKConfirm;
-
-
-
-/**
- * A transaction output watched by a [`ChannelMonitor`] for spends on-chain.
- *
- * Used to convey to a [`Filter`] such an output with a given spending condition. Any transaction
- * spending the output must be given to [`ChannelMonitor::block_connected`] either directly or via
- * the return value of [`Filter::register_output`].
- *
- * If `block_hash` is `Some`, this indicates the output was created in the corresponding block and
- * may have been spent there. See [`Filter::register_output`] for details.
- *
- * [`ChannelMonitor`]: channelmonitor::ChannelMonitor
- * [`ChannelMonitor::block_connected`]: channelmonitor::ChannelMonitor::block_connected
- */
-typedef struct MUST_USE_STRUCT LDKWatchedOutput {
- /**
- * A pointer to the opaque Rust object.
- * Nearly everywhere, inner must be non-null, however in places where
- * the Rust equivalent takes an Option, it may be set to null to indicate None.
- */
- LDKnativeWatchedOutput *inner;
- /**
- * Indicates that this is the only struct which contains the same pointer.
- * Rust functions which take ownership of an object provided via an argument require
- * this to be true and invalidate the object pointed to by inner.
- */
- bool is_owned;
-} LDKWatchedOutput;
-
-/**
- * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
- * channels.
- *
- * This is useful in order to have a [`Watch`] implementation convey to a chain source which
- * transactions to be notified of. Notification may take the form of pre-filtering blocks or, in
- * the case of [BIP 157]/[BIP 158], only fetching a block if the compact filter matches. If
- * receiving full blocks from a chain source, any further filtering is unnecessary.
- *
- * After an output has been registered, subsequent block retrievals from the chain source must not
- * exclude any transactions matching the new criteria nor any in-block descendants of such
- * transactions.