do not duplicate blacklist entries
parent
5b20930d5c
commit
91c1e22324
|
@ -214,6 +214,9 @@ class OnionrCommunicatorDaemon:
|
||||||
self._core._utils.processBlockMetadata(blockHash) # caches block metadata values to block database
|
self._core._utils.processBlockMetadata(blockHash) # caches block metadata values to block database
|
||||||
else:
|
else:
|
||||||
logger.warn('POW failed for block ' + blockHash)
|
logger.warn('POW failed for block ' + blockHash)
|
||||||
|
else:
|
||||||
|
if self._core._blacklist.inBlacklist(realHash):
|
||||||
|
logger.warn('%s is blacklisted' % (realHash,))
|
||||||
else:
|
else:
|
||||||
logger.warn('Metadata for ' + blockHash + ' is invalid.')
|
logger.warn('Metadata for ' + blockHash + ' is invalid.')
|
||||||
self._core._blacklist.addToDB(blockHash)
|
self._core._blacklist.addToDB(blockHash)
|
||||||
|
|
|
@ -95,6 +95,10 @@ class OnionrBlackList:
|
||||||
'''
|
'''
|
||||||
# we hash the data so we can remove data entirely from our node's disk
|
# we hash the data so we can remove data entirely from our node's disk
|
||||||
hashed = self._core._utils.bytesToStr(self._core._crypto.sha3Hash(data))
|
hashed = self._core._utils.bytesToStr(self._core._crypto.sha3Hash(data))
|
||||||
|
|
||||||
|
if self.inBlacklist(hashed):
|
||||||
|
return
|
||||||
|
|
||||||
if not hashed.isalnum():
|
if not hashed.isalnum():
|
||||||
raise Exception("Hashed data is not alpha numeric")
|
raise Exception("Hashed data is not alpha numeric")
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue