Encode WIF string before passing to highlevelcrypto.decodeWalletImportFormat()

This commit is contained in:
Lee Miller 2024-04-14 04:31:02 +03:00
parent acab92c561
commit d547a8be2f
Signed by untrusted user: lee.miller
GPG Key ID: 4F97A5EA88F4AB63
2 changed files with 7 additions and 6 deletions

View File

@ -201,10 +201,11 @@ class singleWorker(StoppableThread):
'Could not read or decode privkey for address %s', address)
raise ValueError
privSigningKeyHex = hexlify(
highlevelcrypto.decodeWalletImportFormat(privSigningKeyBase58))
privSigningKeyHex = hexlify(highlevelcrypto.decodeWalletImportFormat(
privSigningKeyBase58.encode()))
privEncryptionKeyHex = hexlify(
highlevelcrypto.decodeWalletImportFormat(privEncryptionKeyBase58))
highlevelcrypto.decodeWalletImportFormat(
privEncryptionKeyBase58.encode()))
# The \x04 on the beginning of the public keys are not sent.
# This way there is only one acceptable way to encode
@ -1113,7 +1114,7 @@ class singleWorker(StoppableThread):
continue
privEncryptionKeyHex = hexlify(
highlevelcrypto.decodeWalletImportFormat(
privEncryptionKeyBase58))
privEncryptionKeyBase58.encode()))
pubEncryptionKeyBase256 = unhexlify(highlevelcrypto.privToPub(
privEncryptionKeyHex))[1:]
requiredAverageProofOfWorkNonceTrialsPerByte = \

View File

@ -102,8 +102,8 @@ def reloadMyAddressHashes():
# Returns a simple 32 bytes of information encoded in 64 Hex characters
try:
privEncryptionKey = hexlify(
highlevelcrypto.decodeWalletImportFormat(
config.get(addressInKeysFile, 'privencryptionkey')
highlevelcrypto.decodeWalletImportFormat(config.get(
addressInKeysFile, 'privencryptionkey').encode()
))
except ValueError:
logger.error(