File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ where Self::Descr: DescriptorRgb<K>
187
187
.collect();
188
188
state.sort_by_key(|(sum, _, _)| *sum);
189
189
let mut sum = Amount::ZERO;
190
- state
190
+ let selection = state
191
191
.iter()
192
192
.rev()
193
193
.take_while(|(val, _, _)| {
@@ -199,7 +199,12 @@ where Self::Descr: DescriptorRgb<K>
199
199
}
200
200
})
201
201
.map(|(_, seal, _)| *seal)
202
- .collect::<BTreeSet<_>>()
202
+ .collect::<BTreeSet<_>>();
203
+ if sum < amount {
204
+ bset![]
205
+ } else {
206
+ selection
207
+ }
203
208
}
204
209
InvoiceState::Data(NonFungible::RGB21(allocation)) => {
205
210
let data_state = DataState::from(allocation);
@@ -220,6 +225,9 @@ where Self::Descr: DescriptorRgb<K>
220
225
)]
221
226
}
222
227
};
228
+ if prev_outputs.is_empty() {
229
+ return Err(CompositionError::InsufficientState);
230
+ }
223
231
let prev_outpoints = prev_outputs
224
232
.iter()
225
233
// TODO: Support liquid
You can’t perform that action at this time.
0 commit comments