From: LLFourn Date: Tue, 5 Jan 2021 00:43:49 +0000 (+1100) Subject: Add comment explaining why params and coin_selection are Options X-Git-Tag: v0.4.0~34 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.DecoderReader.html?a=commitdiff_plain;h=7bf46c7d7182fb372bbf0ecb919d4150e363be3d;p=bdk Add comment explaining why params and coin_selection are Options --- diff --git a/src/wallet/tx_builder.rs b/src/wallet/tx_builder.rs index d7b379f4..089aad43 100644 --- a/src/wallet/tx_builder.rs +++ b/src/wallet/tx_builder.rs @@ -124,8 +124,11 @@ impl TxBuilderContext for BumpFee {} /// [`finish`]: Self::finish /// [`coin_selection`]: Self::coin_selection pub struct TxBuilder<'a, B, D, Cs, Ctx> { - pub(crate) params: Option, pub(crate) wallet: &'a Wallet, + // params and coin_selection are Options not becasue they are optionally set (they are always + // there) but because `.finish()` uses `Option::take` to get an owned value from a &mut self. + // They are only `None` after `.finish()` is called. + pub(crate) params: Option, pub(crate) coin_selection: Option, pub(crate) phantom: PhantomData, }