diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/consensus/consensus-simulation.py.in | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/consensus/consensus-simulation.py.in b/src/consensus/consensus-simulation.py.in index 12bef871d..6629ffaa8 100644 --- a/src/consensus/consensus-simulation.py.in +++ b/src/consensus/consensus-simulation.py.in | |||
@@ -22,6 +22,7 @@ from __future__ import print_function | |||
22 | import argparse | 22 | import argparse |
23 | import random | 23 | import random |
24 | from math import ceil, log, floor | 24 | from math import ceil, log, floor |
25 | from past.builtins import xrange | ||
25 | 26 | ||
26 | 27 | ||
27 | def bsc(n): | 28 | def bsc(n): |
@@ -44,6 +45,8 @@ def simulate(k, n, verbose): | |||
44 | print("we have", num_ghosts, "ghost peers") | 45 | print("we have", num_ghosts, "ghost peers") |
45 | # n.b. all peers with idx<k are evil | 46 | # n.b. all peers with idx<k are evil |
46 | peers = range(n) | 47 | peers = range(n) |
48 | # py2-3 compatible, backwards. | ||
49 | # refer to http://python-future.org/compatible_idioms.html#xrange | ||
47 | info = [1 << x for x in xrange(n)] | 50 | info = [1 << x for x in xrange(n)] |
48 | 51 | ||
49 | def done_p(): | 52 | def done_p(): |