From c674e2d281f2534169b0c2522deba38820c0fba1 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 20 Apr 2019 19:31:14 -0500 Subject: [PATCH] Fixed spam for block processing --- onionr/api.py | 1 - onionr/onionrutils.py | 2 +- onionr/static-data/default-plugins/metadataprocessor/main.py | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/onionr/api.py b/onionr/api.py index 2f320fbc..c9b3a865 100755 --- a/onionr/api.py +++ b/onionr/api.py @@ -579,7 +579,6 @@ class API: else: validSig = False signer = self._core._utils.bytesToStr(bl.signer) - #print(signer, bl.isSigned(), self._core._utils.validatePubKey(signer), bl.isSigner(signer)) if bl.isSigned() and self._core._utils.validatePubKey(signer) and bl.isSigner(signer): validSig = True bl.bheader['validSig'] = validSig diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index fa75f72a..2637b905 100755 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -157,6 +157,7 @@ class OnionrUtils: ''' Read metadata from a block and cache it to the block database ''' + onionrevents.event('processblocks', data = {'block': myBlock, 'type': blockType, 'signer': signer, 'validSig': valid}, onionr = None) curTime = self.getRoundedEpoch(roundS=60) myBlock = Block(blockHash, self._core) if myBlock.isEncrypted: @@ -171,7 +172,6 @@ class OnionrUtils: try: if len(blockType) <= 10: self._core.updateBlockInfo(blockHash, 'dataType', blockType) - onionrevents.event('processblocks', data = {'block': myBlock, 'type': blockType, 'signer': signer, 'validSig': valid}, onionr = None) except TypeError: logger.warn("Missing block information") pass diff --git a/onionr/static-data/default-plugins/metadataprocessor/main.py b/onionr/static-data/default-plugins/metadataprocessor/main.py index 346600ff..5feb4305 100755 --- a/onionr/static-data/default-plugins/metadataprocessor/main.py +++ b/onionr/static-data/default-plugins/metadataprocessor/main.py @@ -39,13 +39,12 @@ def _processForwardKey(api, myBlock): if api.get_utils().validatePubKey(key): peer.addForwardKey(key) else: - raise onionrexceptions.InvalidPubkey("%s is nota valid pubkey key" % (key,)) + raise onionrexceptions.InvalidPubkey("%s is not a valid pubkey key" % (key,)) def on_processblocks(api, data=None): # Generally fired by utils. myBlock = api.data['block'] blockType = api.data['type'] - # Process specific block types # forwardKey blocks, add a new forward secrecy key for a peer