Skip to content

Commit

Permalink
Move back lock to same place as before
Browse files Browse the repository at this point in the history
  • Loading branch information
maplant committed Jul 27, 2023
1 parent 84608e2 commit 7313e48
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions iot_packet_verifier/src/burner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ where

let amount = amount as u64;

let mut balance_lock = self.balances.lock().await;

self.solana
.burn_data_credits(&payer, amount)
.await
Expand All @@ -84,6 +82,7 @@ where
.await
.map_err(BurnError::SqlError)?;

let mut balance_lock = self.balances.lock().await;
let payer_account = balance_lock.get_mut(&payer).unwrap();
payer_account.burned -= amount;
// Reset the balance of the payer:
Expand Down

0 comments on commit 7313e48

Please sign in to comment.