Make accountant thread-safe
Before this change, parallel transaction processing required locking the full accountant. Since we only call one method, process_verified_transaction, the global lock equates to doing no parallelization at all. With this change, we only lock the data that's being written to.
This commit is contained in:
@@ -32,7 +32,7 @@ fn main() {
|
||||
None
|
||||
};
|
||||
|
||||
let mut acc = Accountant::new_from_deposit(&deposit.unwrap());
|
||||
let acc = Accountant::new_from_deposit(&deposit.unwrap());
|
||||
|
||||
let mut last_id = entry1.id;
|
||||
for entry in entries {
|
||||
|
Reference in New Issue
Block a user