Fix.
This commit is contained in:
parent
917ad559e0
commit
b652ddb99f
1 changed files with 3 additions and 2 deletions
|
@ -115,12 +115,13 @@ fn extract_transfers(
|
||||||
account_balances.len()
|
account_balances.len()
|
||||||
);
|
);
|
||||||
let edge = next_full_capacity_edge(&mut used_edges, &mut account_balances);
|
let edge = next_full_capacity_edge(&mut used_edges, &mut account_balances);
|
||||||
|
assert!(account_balances.contains_key(&edge.from));
|
||||||
account_balances
|
account_balances
|
||||||
.entry(edge.from)
|
.entry(edge.from)
|
||||||
.and_modify(|balance| *balance -= edge.capacity);
|
.and_modify(|balance| *balance -= edge.capacity);
|
||||||
account_balances
|
*account_balances
|
||||||
.entry(edge.to)
|
.entry(edge.to)
|
||||||
.and_modify(|balance| *balance += edge.capacity);
|
.or_default() += edge.capacity;
|
||||||
account_balances.retain(|_account, balance| balance > &mut U256::from(0));
|
account_balances.retain(|_account, balance| balance > &mut U256::from(0));
|
||||||
used_edges
|
used_edges
|
||||||
.entry(Node::Node(edge.from))
|
.entry(Node::Node(edge.from))
|
||||||
|
|
Loading…
Reference in a new issue