Fix positional argument bug

master
Arinerron 2018-05-12 23:37:47 -07:00
parent 71f4318719
commit f0e842eae4
No known key found for this signature in database
GPG Key ID: 99383627861C62F0
4 changed files with 8 additions and 11 deletions

View File

@ -447,7 +447,7 @@ class OnionrCommunicate:
if isThread:
self.lookupBlocksThreads += 1
peerList = self._core.listAdders()
blocks = ''
blockList = list()
for i in peerList:
if self.peerStatusTaken(i, 'getBlockHashes') or self.peerStatusTaken(i, 'getDBHash'):
@ -476,18 +476,15 @@ class OnionrCommunicate:
if lastDB != currentDB:
logger.debug('Fetching hash from %s - %s current hash.' % (str(i), currentDB))
try:
blocks += self.performGet('getBlockHashes', i)
blockList.append(self.performGet('getBlockHashes', i))
except TypeError:
logger.warn('Failed to get data hash from %s' % str(i))
self.peerData[i]['failCount'] -= 1
if self._utils.validateHash(currentDB):
self._core.setAddressInfo(i, "DBHash", currentDB)
if len(blocks.strip()) != 0:
if len(blockList) != 0:
pass
#logger.debug('BLOCKS:' + blocks)
blockList = blocks.split('\n')
for i in blockList:
if len(i.strip()) == 0:

View File

@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
'''
import nacl.signing, nacl.encoding, nacl.public, nacl.hash, nacl.secret, os, binascii, base64, hashlib, logger, onionrproofs, time
import nacl.signing, nacl.encoding, nacl.public, nacl.hash, nacl.secret, os, binascii, base64, hashlib, logger, onionrproofs, time, math
class OnionrCrypto:
def __init__(self, coreInstance):

View File

@ -153,8 +153,8 @@ class pluginapi:
def get_utils(self):
return self.get_onionr().onionrUtils
def get_crypto():
return self.get_core().crypto
def get_crypto(self):
return self.get_core()._crypto
def get_daemonapi(self):
return self.daemon

View File

@ -97,13 +97,13 @@ def parseBlock(hash, key):# deal with block metadata
blockContent = pluginapi.get_core().getData(hash)
try:
blockMetadata = json.loads(blockContent[:blockContent.decode().find(b'}') + 1].decode())
blockMetadata = json.loads(blockContent[:blockContent.decode().find('\n')].decode())
try:
blockMeta2 = json.loads(blockMetadata['meta'])
except KeyError:
blockMeta2 = {'type': ''}
pass
blockContent = blockContent[blockContent.rfind(b'}') + 1:]
blockContent = blockContent[blockContent.rfind(b'\n') + 1:]
try:
blockContent = blockContent.decode()
except AttributeError: