add some more useful logging for failed signed blocks in validatemetadata

master
Kevin Froman 2020-08-23 06:29:12 -05:00
parent 15379a7c2f
commit 68aac2153b
1 changed files with 1 additions and 0 deletions

View File

@ -90,6 +90,7 @@ def validate_metadata(metadata, block_data) -> bool:
encodedMeta = bytesconverter.str_to_bytes(metadata['meta'])
encodedBlock = bytesconverter.str_to_bytes(block_data)
if not onionrcrypto.signing.ed_verify(encodedMeta + encodedBlock[1:], signer, sig):
logger.warn(f'Block was signed by {signer}, but signature failed')
break
else:
# if metadata loop gets no errors, it does not break, therefore metadata is valid