From 735db0285094131bed4c13f533f6a89fb9a07e77 Mon Sep 17 00:00:00 2001 From: LLFourn Date: Tue, 5 Jan 2021 12:08:43 +1100 Subject: [PATCH] Assert that `.finish()` hasn't been called already in coin_selection --- src/wallet/tx_builder.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wallet/tx_builder.rs b/src/wallet/tx_builder.rs index 089aad43..a9ed5d8b 100644 --- a/src/wallet/tx_builder.rs +++ b/src/wallet/tx_builder.rs @@ -414,6 +414,10 @@ impl<'a, B, D: BatchDatabase, Cs: CoinSelectionAlgorithm, Ctx: TxBuilderConte self, coin_selection: P, ) -> TxBuilder<'a, B, D, P, Ctx> { + assert!( + self.coin_selection.is_some(), + "can't set coin_selection after finish() has been called" + ); TxBuilder { wallet: self.wallet, params: self.params,