The taking of locks in this struct is prone to race conditions. Example.
let selected_inputs = self
.select_inputs(input_selection_policy, spend_amount, timestamp)
.await?;
trace!("selected {} inputs for transaction.", selected_inputs.len());
let unlocked_inputs = self
.global_state_lock
.lock_guard()
.await
.unlock_inputs(selected_inputs)
.await;
If a new transaction enters into the mempool between there two expressions, it can cause a panic in unlock_inputs. There are more problems in this method. The consolidate method on the same struct has the same problem.
The taking of locks in this struct is prone to race conditions. Example.
If a new transaction enters into the mempool between there two expressions, it can cause a panic in
unlock_inputs. There are more problems in this method. Theconsolidatemethod on the same struct has the same problem.