Assert that .finish() hasn't been called already in coin_selection

This commit is contained in:
LLFourn 2021-01-05 12:08:43 +11:00
parent 7bf46c7d71
commit 735db02850
No known key found for this signature in database
GPG Key ID: A27093B54DA11F65

View File

@ -414,6 +414,10 @@ impl<'a, B, D: BatchDatabase, Cs: CoinSelectionAlgorithm<D>, 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,