mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-09-04 12:55:10 +00:00
fix issue #1282
This commit is contained in:
parent
bf50bc45ef
commit
16344b43af
2 changed files with 5 additions and 7 deletions
|
@ -131,7 +131,7 @@ class Commands:
|
||||||
def make_seed(self, nbits=128, entropy=1, language=None):
|
def make_seed(self, nbits=128, entropy=1, language=None):
|
||||||
"""Create a seed"""
|
"""Create a seed"""
|
||||||
from mnemonic import Mnemonic
|
from mnemonic import Mnemonic
|
||||||
s = Mnemonic(language).make_seed(nbits, custom_entropy=custom_entropy)
|
s = Mnemonic(language).make_seed(nbits, custom_entropy=entropy)
|
||||||
return s.encode('utf8')
|
return s.encode('utf8')
|
||||||
|
|
||||||
@command('')
|
@command('')
|
||||||
|
|
|
@ -705,13 +705,12 @@ class Transaction:
|
||||||
|
|
||||||
def sign(self, keypairs):
|
def sign(self, keypairs):
|
||||||
for i, txin in enumerate(self.inputs):
|
for i, txin in enumerate(self.inputs):
|
||||||
signatures = filter(None, txin['signatures'])
|
|
||||||
num = txin['num_sig']
|
num = txin['num_sig']
|
||||||
if len(signatures) == num:
|
|
||||||
# continue if this txin is complete
|
|
||||||
continue
|
|
||||||
|
|
||||||
for x_pubkey in txin['x_pubkeys']:
|
for x_pubkey in txin['x_pubkeys']:
|
||||||
|
signatures = filter(None, txin['signatures'])
|
||||||
|
if len(signatures) == num:
|
||||||
|
# txin is complete
|
||||||
|
break
|
||||||
if x_pubkey in keypairs.keys():
|
if x_pubkey in keypairs.keys():
|
||||||
print_error("adding signature for", x_pubkey)
|
print_error("adding signature for", x_pubkey)
|
||||||
# add pubkey to txin
|
# add pubkey to txin
|
||||||
|
@ -733,7 +732,6 @@ class Transaction:
|
||||||
assert public_key.verify_digest( sig, for_sig, sigdecode = ecdsa.util.sigdecode_der)
|
assert public_key.verify_digest( sig, for_sig, sigdecode = ecdsa.util.sigdecode_der)
|
||||||
txin['signatures'][ii] = sig.encode('hex')
|
txin['signatures'][ii] = sig.encode('hex')
|
||||||
self.inputs[i] = txin
|
self.inputs[i] = txin
|
||||||
|
|
||||||
print_error("is_complete", self.is_complete())
|
print_error("is_complete", self.is_complete())
|
||||||
self.raw = self.serialize()
|
self.raw = self.serialize()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue