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:
Greg Fitzgerald
2018-04-04 12:33:00 -06:00
parent 123d7c6a37
commit 0c60fdd2ce
2 changed files with 48 additions and 43 deletions

View File

@@ -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 {