diff --git a/massa-execution-worker/src/context.rs b/massa-execution-worker/src/context.rs index a58576577b9..e77060c5394 100644 --- a/massa-execution-worker/src/context.rs +++ b/massa-execution-worker/src/context.rs @@ -364,12 +364,12 @@ impl ExecutionContext { &mut self, max_gas: u64, async_msg_cst_gas_cost: u64, - ) -> Vec<(Option, AsyncMessage)> { - self.speculative_async_pool - .take_batch_to_execute(self.slot, max_gas, async_msg_cst_gas_cost) - .into_iter() - .map(|(_id, msg)| (self.get_bytecode(&msg.destination), msg)) - .collect() + ) -> Vec<(AsyncMessageId, AsyncMessage)> { + self.speculative_async_pool.take_batch_to_execute( + self.slot, + max_gas, + async_msg_cst_gas_cost, + ) } /// Create a new `ExecutionContext` for executing an active slot. diff --git a/massa-execution-worker/src/execution.rs b/massa-execution-worker/src/execution.rs index 297538ff8e9..fcc1ccb5a07 100644 --- a/massa-execution-worker/src/execution.rs +++ b/massa-execution-worker/src/execution.rs @@ -1271,7 +1271,9 @@ impl ExecutionState { // Try executing asynchronous messages. // Effects are cancelled on failure and the sender is reimbursed. - for (opt_bytecode, message) in messages { + for (_message_id, message) in messages { + let opt_bytecode = context_guard!(self).get_bytecode(&message.destination); + match self.execute_async_message(message, opt_bytecode) { Ok(_message_return) => { cfg_if::cfg_if! {