Skip to content

Commit 9e041dc

Browse files
authored
Return earlier if the too many currencies (#712)
* Return earlier if the too many currencies Signed-off-by: Dengjianping <[email protected]> * Rollback do_transfer_multiassets for checking currencies Signed-off-by: Dengjianping <[email protected]>
1 parent 0a5a2df commit 9e041dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

xtokens/src/lib.rs

+5
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,11 @@ pub mod module {
435435
dest: MultiLocation,
436436
dest_weight: Weight,
437437
) -> DispatchResult {
438+
ensure!(
439+
currencies.len() <= T::MaxAssetsForTransfer::get(),
440+
Error::<T>::TooManyAssetsBeingSent
441+
);
442+
438443
let mut assets = MultiAssets::new();
439444

440445
// Lets grab the fee amount and location first

0 commit comments

Comments
 (0)