1
0

separate bitcoin related functions from wallet.py

This commit is contained in:
thomasv
2012-10-19 14:55:01 +02:00
parent 728ae0d184
commit 5717b43661
6 changed files with 242 additions and 229 deletions

View File

@@ -2,21 +2,11 @@
import sys, hashlib
from electrum import Interface
from electrum.bitcoin import Hash, rev_hex, int_to_hex
"""validate a transaction (SPV)"""
Hash = lambda x: hashlib.sha256(hashlib.sha256(x).digest()).digest()
def rev_hex(s):
return s.decode('hex')[::-1].encode('hex')
def int_to_hex(i, length=1):
s = hex(i)[2:].rstrip('L')
s = "0"*(2*length - len(s)) + s
return rev_hex(s)
i = Interface({'server':'ecdsa.org:50002:s'})
i.start()