+ * Updates channel state with the current best blockchain tip. You should attempt to call this
+ * quickly after a new block becomes available, however if multiple new blocks become
+ * available at the same time, only a single `update_best_block()` call needs to be made.
+ *
+ * This method should also be called immediately after any block disconnections, once at the
+ * reorganization fork point, and once with the new chain tip. Calling this method at the
+ * blockchain reorganization fork point ensures we learn when a funding transaction which was
+ * previously confirmed is reorganized out of the blockchain, ensuring we do not continue to
+ * accept payments which cannot be enforced on-chain.
+ *
+ * In both the block-connection and block-disconnection case, this method may be called either
+ * once per block connected or disconnected, or simply at the fork point and new tip(s),
+ * skipping any intermediary blocks.
+ */
+ public void update_best_block(byte[] header, int height) {
+ bindings.ChannelManager_update_best_block(this.ptr, header, height);
+ }
+
+ /**
+ * Gets the set of txids which should be monitored for their confirmation state.
+ *
+ * If you're providing information about reorganizations via [`transaction_unconfirmed`], this
+ * is the set of transactions which you may need to call [`transaction_unconfirmed`] for.
+ *
+ * This may be useful to poll to determine the set of transactions which must be registered
+ * with an Electrum server or for which an Electrum server needs to be polled to determine
+ * transaction confirmation state.
+ *
+ * This may update after any [`transactions_confirmed`] or [`block_connected`] call.
+ *
+ * Note that this is NOT the set of transactions which must be included in calls to
+ * [`transactions_confirmed`] if they are confirmed, but a small subset of it.
+ *
+ * [`transactions_confirmed`]: Self::transactions_confirmed
+ * [`transaction_unconfirmed`]: Self::transaction_unconfirmed
+ * [`block_connected`]: chain::Listen::block_connected
+ */
+ public byte[][] get_relevant_txids() {
+ byte[][] ret = bindings.ChannelManager_get_relevant_txids(this.ptr);
+ return ret;
+ }
+
+ /**
+ * Marks a transaction as having been reorganized out of the blockchain.
+ *
+ * If a transaction is included in [`get_relevant_txids`], and is no longer in the main branch
+ * of the blockchain, this function should be called to indicate that the transaction should
+ * be considered reorganized out.
+ *
+ * Once this is called, the given transaction will no longer appear on [`get_relevant_txids`],
+ * though this may be called repeatedly for a given transaction without issue.
+ *
+ * Note that if the transaction is confirmed on the main chain in a different block (indicated
+ * via a call to [`transactions_confirmed`]), it may re-appear in [`get_relevant_txids`], thus
+ * be very wary of race-conditions wherein the final state of a transaction indicated via
+ * these APIs is not the same as its state on the blockchain.