* do not report inserted message if keyboard interrupt/failure
* do not crash on keyboard interrupt in powmaster
parent
b3b5e5bb50
commit
9083775887
|
@ -674,6 +674,7 @@ class Core:
|
|||
Inserts a block into the network
|
||||
encryptType must be specified to encrypt a block
|
||||
'''
|
||||
retData = False
|
||||
|
||||
if meta is None:
|
||||
meta = dict()
|
||||
|
@ -736,10 +737,10 @@ class Core:
|
|||
# send block data (and metadata) to POW module to get tokenized block data
|
||||
proof = onionrproofs.POW(metadata, data)
|
||||
payload = proof.waitForResult()
|
||||
|
||||
retData = self.setData(payload)
|
||||
self.addToBlockDB(retData, selfInsert=True, dataSaved=True)
|
||||
self.setBlockType(retData, meta['type'])
|
||||
if payload != False:
|
||||
retData = self.setData(payload)
|
||||
self.addToBlockDB(retData, selfInsert=True, dataSaved=True)
|
||||
self.setBlockType(retData, meta['type'])
|
||||
|
||||
return retData
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@ class Onionr:
|
|||
|
||||
#addedHash = Block(type = 'txt', content = messageToAdd).save()
|
||||
addedHash = self.onionrCore.insertBlock(messageToAdd)
|
||||
if addedHash != None:
|
||||
if addedHash != None and addedHash != False and addedHash != "":
|
||||
logger.info("Message inserted as as block %s" % addedHash)
|
||||
else:
|
||||
logger.error('Failed to insert block.', timestamp = False)
|
||||
|
|
|
@ -169,7 +169,7 @@ class OnionrUtils:
|
|||
retData = requests.get(payload).text
|
||||
except Exception as error:
|
||||
if not silent:
|
||||
logger.debug('Failed to make local request (command: %s).' % command, error=error)
|
||||
logger.error('Failed to make local request (command: %s):%s' % (command, error))
|
||||
retData = False
|
||||
|
||||
return retData
|
||||
|
|
Loading…
Reference in New Issue