Fix subtle indices bug (#2128)

* Fix subtle indices bug

* Also fix balances divide by zero.
This commit is contained in:
Gav Wood
2019-03-27 17:46:30 +01:00
committed by GitHub
parent 823abc2fc0
commit 039acb9518
5 changed files with 32 additions and 4 deletions
+1 -1
View File
@@ -312,7 +312,7 @@ decl_storage! {
// <= begin it should be >= balance
// >= begin+length it should be <= 0
let per_block = balance / length;
let per_block = balance / length.max(primitives::traits::One::one());
let offset = begin * per_block + balance;
(who.clone(), VestingSchedule { offset, per_block })