tfix: below or equal in var_int encoding - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit faa002f53ce37a2941e82800bd518c56cc57637b DIR parent 4038c0273fa5a1d0aa787f392ad8a8e58afb148b HTML Author: ThomasV <thomasv@gitorious> Date: Fri, 26 Oct 2012 22:51:33 +0200 fix: below or equal in var_int encoding Diffstat: M lib/bitcoin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- DIR diff --git a/lib/bitcoin.py b/lib/bitcoin.py t@@ -31,9 +31,9 @@ def int_to_hex(i, length=1): def var_int(i): if i<0xfd: return int_to_hex(i) - elif i<0xffff: + elif i<=0xffff: return "fd"+int_to_hex(i,2) - elif i<0xffffffff: + elif i<=0xffffffff: return "fe"+int_to_hex(i,4) else: return "ff"+int_to_hex(i,8)