mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-03 02:35:20 +00:00
bugfix + verifymessage
This commit is contained in:
parent
de19da75d2
commit
58d73c66e0
2 changed files with 16 additions and 7 deletions
|
@ -66,15 +66,20 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
params = []
|
params = []
|
||||||
cmd = 'gui'
|
cmd = 'gui'
|
||||||
amount = ''
|
amount = label = signature = signer = ''
|
||||||
label = ''
|
|
||||||
for p in params:
|
for p in params:
|
||||||
k,v = p.split('=')
|
k,v = p.split('=')
|
||||||
v = urldecode(v)
|
v = urldecode(v)
|
||||||
if k=='amount': amount = v
|
if k=='amount': amount = v
|
||||||
elif k=='label': label = v
|
elif k=='label': label = v
|
||||||
|
elif k =='signature': signature = v
|
||||||
|
elif k =='signer': signer = v
|
||||||
else: print k,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.set_send_tab(address, amount, label)
|
||||||
|
|
||||||
gui.main()
|
gui.main()
|
||||||
|
|
|
@ -345,6 +345,10 @@ class Wallet:
|
||||||
return pk
|
return pk
|
||||||
|
|
||||||
|
|
||||||
|
def verify_message(self, signing_address, signature, message):
|
||||||
|
""" recover public key from signature; """
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def create_new_address2(self, for_change):
|
def create_new_address2(self, for_change):
|
||||||
""" Publickey(type,n) = Master_public_key + H(n|S|type)*point """
|
""" 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):
|
def mktx(self, to_address, amount, label, password, fee=None):
|
||||||
if not self.is_valid(to_address):
|
if not self.is_valid(to_address):
|
||||||
raise BaseException("Invalid 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:
|
if not inputs:
|
||||||
raise BaseException("Not enough funds")
|
raise BaseException("Not enough funds")
|
||||||
outputs = wallet.choose_tx_outputs( to_address, amount, fee, total )
|
outputs = self.choose_tx_outputs( to_address, amount, fee, total )
|
||||||
s_inputs = wallet.sign_inputs( inputs, outputs, password )
|
s_inputs = self.sign_inputs( inputs, outputs, password )
|
||||||
|
|
||||||
tx = filter( raw_tx( s_inputs, outputs ) )
|
tx = filter( raw_tx( s_inputs, outputs ) )
|
||||||
if to_address not in self.addressbook:
|
if to_address not in self.addressbook:
|
||||||
self.addressbook.append(to_address)
|
self.addressbook.append(to_address)
|
||||||
if label:
|
if label:
|
||||||
tx_hash = Hash(tx.decode('hex') )[::-1].encode('hex')
|
tx_hash = Hash(tx.decode('hex') )[::-1].encode('hex')
|
||||||
wallet.labels[tx_hash] = label
|
self.labels[tx_hash] = label
|
||||||
wallet.save()
|
self.save()
|
||||||
return tx
|
return tx
|
||||||
|
|
||||||
def sendtx(self, tx):
|
def sendtx(self, tx):
|
||||||
|
|
Loading…
Add table
Reference in a new issue