Skip to content

Commit

Permalink
fix reentrancy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
claravanstaden committed Dec 5, 2024
1 parent 40e85ea commit d70ac6c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bridges/snowbridge/pallets/inbound-queue-v2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ pub mod pallet {

// Attempt to forward XCM to AH

let message_id = Self::send_xcm(xcm, T::AssetHubParaId::get())?;
Self::deposit_event(Event::MessageReceived { nonce: envelope.nonce, message_id });

// Set nonce flag to true
Nonce::<T>::set(envelope.nonce.into());

let message_id = Self::send_xcm(xcm, T::AssetHubParaId::get())?;
Self::deposit_event(Event::MessageReceived { nonce: envelope.nonce, message_id });

Ok(())
}

Expand Down

0 comments on commit d70ac6c

Please sign in to comment.