Skip to content

Commit

Permalink
wif_to_privkey fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed May 27, 2017
1 parent 046bbe6 commit 6aac9fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pypeerassets/kutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ def load_network_parameters(self, query: str):
for field, var in zip(networks.query(query)._fields, networks.query(query)):
setattr(self, field, var)

def wif_to_privkey(self, wif: str) -> bytes:
def wif_to_privkey(self, wif: str):
'''import WIF'''
if 51 < len(wif) < 52:
if not 51 <= len(wif) <= 52:
return 'Invalid WIF length'

b58_wif = b58decode(wif)
return {'privkey': b58_wif, 'net_prefix': hexlify(b58_wif[0:1])}
return {'privkey': b58_wif[1:33], 'net_prefix': hexlify(b58_wif[0:1])}

@property
def address(self) -> str:
Expand Down

0 comments on commit 6aac9fa

Please sign in to comment.