hm, some trouble with inserted accounts
@@ -181,6 +181,8 @@ impl PlasmaStateKeeper {
affected_accounts: FnvHashSet::default(),
};
+ let mut affected_accounts: FnvHashSet<u32> = FnvHashSet::default();
+
while applied_transactions.len() < config::TRANSFER_BATCH_SIZE {
let next_from = queue.peek_next();
@@ -210,12 +212,12 @@ impl PlasmaStateKeeper {
println!("accepted transaction for account {}, nonce {}", tx.from, tx.nonce);
applied_transactions.push(tx);
response.included.push(pool_tx);
- response.affected_accounts.insert(next_from);
+ affected_accounts.insert(next_from);
},
Err(error_type) => {
self.state.balance_tree.insert(tx.from, from);
self.state.balance_tree.insert(tx.to, to);
- response.affected_accounts.insert(next_from);
+ affected_accounts.insert(next_from);
match error_type {
TransferApplicationError::InsufficientBalance => {
println!("insufficient balance");
@@ -239,6 +241,8 @@ impl PlasmaStateKeeper {
// TODO: implement padding
}
+ response.affected_accounts = affected_accounts;
+
assert_eq!(applied_transactions.len(), response.included.len());
if applied_transactions.len() != config::TRANSFER_BATCH_SIZE {
