From: 志宇 Date: Mon, 10 Apr 2023 08:23:10 +0000 (+0800) Subject: [bdk_chain_redesign] Documentation improvements X-Git-Tag: v1.0.0-alpha.1~19^2~20 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandStringError.html?a=commitdiff_plain;h=a7fbe0ac672cde6c308737fc98020f6693071a5f;p=bdk [bdk_chain_redesign] Documentation improvements --- diff --git a/crates/chain/src/chain_data.rs b/crates/chain/src/chain_data.rs index 5615b094..aa1e74d4 100644 --- a/crates/chain/src/chain_data.rs +++ b/crates/chain/src/chain_data.rs @@ -271,6 +271,8 @@ impl FullTxOut> { /// Whether the utxo is/was/will be spendable with chain `tip`. /// + /// Currently this method does not take into account the locktime. + /// /// This is the alternative version of [`is_spendable_at`] which depends on `chain_position` /// being a [`ObservedAs`] where `A` implements [`BlockAnchor`]. /// @@ -286,7 +288,6 @@ impl FullTxOut> { return false; } } - // [TODO] Why are unconfirmed txs always considered unspendable here? ObservedAs::Unconfirmed(_) => return false, }; diff --git a/crates/chain/src/indexed_tx_graph.rs b/crates/chain/src/indexed_tx_graph.rs index dac05e72..2de8114a 100644 --- a/crates/chain/src/indexed_tx_graph.rs +++ b/crates/chain/src/indexed_tx_graph.rs @@ -55,10 +55,11 @@ impl Append for IndexedAdditions { self.graph_additions.append(other.graph_additions); self.index_additions.append(other.index_additions); if self.last_height < other.last_height { - let last_height = other - .last_height - .expect("must exist as it is larger than self.last_height"); - self.last_height.replace(last_height); + self.last_height = Some( + other + .last_height + .expect("must exist as it is larger than self.last_height"), + ); } } }