Revive the parallel bank client from v0.16 (#6903)

This commit is contained in:
Greg Fitzgerald 2019-11-12 15:26:21 -07:00 committed by GitHub
parent 71bf8c5f85
commit 986e9e268e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -239,7 +239,11 @@ impl SyncClient for BankClient {
impl BankClient {
fn run(bank: &Bank, transaction_receiver: Receiver<Transaction>) {
while let Ok(tx) = transaction_receiver.recv() {
let _ = bank.process_transaction(&tx);
let mut transactions = vec![tx];
while let Ok(tx) = transaction_receiver.try_recv() {
transactions.push(tx);
}
let _ = bank.process_transactions(&transactions);
}
}