add some more useful logging for failed signed blocks in validatemetadata
This commit is contained in:
parent
15379a7c2f
commit
68aac2153b
@ -90,6 +90,7 @@ def validate_metadata(metadata, block_data) -> bool:
|
|||||||
encodedMeta = bytesconverter.str_to_bytes(metadata['meta'])
|
encodedMeta = bytesconverter.str_to_bytes(metadata['meta'])
|
||||||
encodedBlock = bytesconverter.str_to_bytes(block_data)
|
encodedBlock = bytesconverter.str_to_bytes(block_data)
|
||||||
if not onionrcrypto.signing.ed_verify(encodedMeta + encodedBlock[1:], signer, sig):
|
if not onionrcrypto.signing.ed_verify(encodedMeta + encodedBlock[1:], signer, sig):
|
||||||
|
logger.warn(f'Block was signed by {signer}, but signature failed')
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# if metadata loop gets no errors, it does not break, therefore metadata is valid
|
# if metadata loop gets no errors, it does not break, therefore metadata is valid
|
||||||
|
Loading…
Reference in New Issue
Block a user