git://git.novaco.in
/
electrum-nvc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
4038c02
)
fix: below or equal in var_int encoding
author
ThomasV
<thomasv@gitorious>
Fri, 26 Oct 2012 20:51:33 +0000 (22:51 +0200)
committer
ThomasV
<thomasv@gitorious>
Fri, 26 Oct 2012 20:51:33 +0000 (22:51 +0200)
lib/bitcoin.py
patch
|
blob
|
history
diff --git
a/lib/bitcoin.py
b/lib/bitcoin.py
index
a2a7993
..
c8e8ba0
100644
(file)
--- a/
lib/bitcoin.py
+++ b/
lib/bitcoin.py
@@
-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)