From: 志宇 Date: Wed, 14 Oct 2026 04:48:48 +0000 (+0000) Subject: docs(chain): document that `apply_block` trusts the given block X-Git-Url: http://internal-gitweb-vhost/-script/src/example_cli/database/encode/struct.EncoderStringWriter.html?a=commitdiff_plain;h=2cce69780e6ca215c450cb9d8ebd1c752339c99b;p=bdk docs(chain): document that `apply_block` trusts the given block Co-Authored-By: Claude Opus 5.5 --- diff --git a/crates/chain/src/indexed_tx_graph.rs b/crates/chain/src/indexed_tx_graph.rs index 4bc42307..9f61788d 100644 --- a/crates/chain/src/indexed_tx_graph.rs +++ b/crates/chain/src/indexed_tx_graph.rs @@ -364,6 +364,10 @@ where /// Relevancy is determined by the internal [`Indexer::is_tx_relevant`] implementation of `I`. /// A transaction that conflicts with a relevant transaction is also considered relevant. /// Irrelevant transactions in `block` will be ignored. + /// + /// The caller must supply a valid block at `height` from a trusted source. This method does not + /// validate the block: neither the header's place in the chain nor that `block.txdata` matches + /// the header's merkle root. pub fn apply_block_relevant( &mut self, block: &Block, @@ -399,6 +403,10 @@ where /// /// To only insert relevant transactions, use [`apply_block_relevant`] instead. /// + /// The caller must supply a valid block at `height` from a trusted source. This method does not + /// validate the block: neither the header's place in the chain nor that `block.txdata` matches + /// the header's merkle root. + /// /// [`apply_block_relevant`]: IndexedTxGraph::apply_block_relevant pub fn apply_block(&mut self, block: Block, height: u32) -> ChangeSet { let block_id = BlockId {