electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit bc591377e8f398a187449b6834c7f01e0d97edde
parent 8e54d5c4d49e2a5319311fffcb109b6360d6340d
Author: ThomasV <thomasv@electrum.org>
Date:   Wed,  1 Mar 2017 10:07:47 +0100

python3: fix integer division

Diffstat:
Mlib/blockchain.py | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/blockchain.py b/lib/blockchain.py @@ -283,9 +283,9 @@ class Blockchain(util.PrintError): # new target nActualTimespan = last.get('timestamp') - first.get('timestamp') nTargetTimespan = 14 * 24 * 60 * 60 - nActualTimespan = max(nActualTimespan, nTargetTimespan / 4) + nActualTimespan = max(nActualTimespan, nTargetTimespan // 4) nActualTimespan = min(nActualTimespan, nTargetTimespan * 4) - new_target = min(MAX_TARGET, (target * nActualTimespan) / nTargetTimespan) + new_target = min(MAX_TARGET, (target * nActualTimespan) // nTargetTimespan) # convert new target to bits c = ("%064x" % new_target)[2:] while c[:2] == '00' and len(c) > 6: