bugfix + verifymessage

This commit is contained in:
thomasv 2012-01-20 17:21:29 +01:00
parent de19da75d2
commit 58d73c66e0
2 changed files with 16 additions and 7 deletions

View File

@ -66,15 +66,20 @@ if __name__ == '__main__':
else:
params = []
cmd = 'gui'
amount = ''
label = ''
amount = label = signature = signer = ''
for p in params:
k,v = p.split('=')
v = urldecode(v)
if k=='amount': amount = v
elif k=='label': label = v
elif k =='signature': signature = v
elif k =='signer': signer = v
else: print k,v
if signature:
message = p.replace('signer=%s'%signer,'').replace('signature=%s'%signature,'')
wallet.verify_message(signer, signature,message)
gui.set_send_tab(address, amount, label)
gui.main()

View File

@ -345,6 +345,10 @@ class Wallet:
return pk
def verify_message(self, signing_address, signature, message):
""" recover public key from signature; """
pass
def create_new_address2(self, for_change):
""" Publickey(type,n) = Master_public_key + H(n|S|type)*point """
@ -631,19 +635,19 @@ class Wallet:
def mktx(self, to_address, amount, label, password, fee=None):
if not self.is_valid(to_address):
raise BaseException("Invalid address")
inputs, total, fee = wallet.choose_tx_inputs( amount, fee )
inputs, total, fee = self.choose_tx_inputs( amount, fee )
if not inputs:
raise BaseException("Not enough funds")
outputs = wallet.choose_tx_outputs( to_address, amount, fee, total )
s_inputs = wallet.sign_inputs( inputs, outputs, password )
outputs = self.choose_tx_outputs( to_address, amount, fee, total )
s_inputs = self.sign_inputs( inputs, outputs, password )
tx = filter( raw_tx( s_inputs, outputs ) )
if to_address not in self.addressbook:
self.addressbook.append(to_address)
if label:
tx_hash = Hash(tx.decode('hex') )[::-1].encode('hex')
wallet.labels[tx_hash] = label
wallet.save()
self.labels[tx_hash] = label
self.save()
return tx
def sendtx(self, tx):