work on block processing module
This commit is contained in:
parent
a44d511e1d
commit
151b12424c
@ -102,6 +102,8 @@ class Core:
|
||||
logger.warn("POW token for pubkey base64 representation exceeded 120 bytes, is " + str(sys.getsizeof(powID)))
|
||||
return False
|
||||
|
||||
events.event('pubkey_add', data = {'key': peerID}, onionr = None)
|
||||
|
||||
conn = sqlite3.connect(self.peerDB)
|
||||
hashID = self._crypto.pubKeyHashID(peerID)
|
||||
c = conn.cursor()
|
||||
|
@ -74,6 +74,7 @@ class NetController:
|
||||
hashedPassword = subprocess.Popen([self.torBinary, '--hash-password', plaintext], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
for line in iter(hashedPassword.stdout.readline, b''):
|
||||
password = line.decode()
|
||||
if 'warn' not in password:
|
||||
break
|
||||
|
||||
torrcData = '''SocksPort ''' + str(self.socksPort) + '''
|
||||
|
@ -23,6 +23,7 @@ import nacl.signing, nacl.encoding
|
||||
from onionrblockapi import Block
|
||||
import onionrexceptions
|
||||
from defusedxml import minidom
|
||||
import onionrevents
|
||||
import pgpwords, onionrusers, storagecounter
|
||||
if sys.version_info < (3, 6):
|
||||
try:
|
||||
@ -276,19 +277,8 @@ class OnionrUtils:
|
||||
if len(blockType) <= 10:
|
||||
self._core.updateBlockInfo(blockHash, 'dataType', blockType)
|
||||
|
||||
if blockType == 'userInfo':
|
||||
if myBlock.verifySig():
|
||||
peerName = myBlock.getMetadata('name')
|
||||
try:
|
||||
if len(peerName) > 20:
|
||||
raise onionrexceptions.InvalidMetdata('Peer name specified is too large')
|
||||
except TypeError:
|
||||
pass
|
||||
except onionrexceptions.InvalidMetadata:
|
||||
pass
|
||||
else:
|
||||
self._core.setPeerInfo(signer, 'name', peerName)
|
||||
logger.info('%s is now using the name %s.' % (signer, self.escapeAnsi(peerName)))
|
||||
onionrevents.event('processBlocks', data = {'block': myBlock, 'type': blockType}, onionr = None)
|
||||
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
|
@ -54,7 +54,7 @@ class OnionrCLIUI:
|
||||
while showMenu:
|
||||
if firstRun:
|
||||
print("please wait while Onionr starts...")
|
||||
daemon = subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT)
|
||||
daemon = subprocess.Popen(["./onionr.py", "start"], stdin=subprocess.PIPE, stdout=subprocess.DEVNULL)
|
||||
time.sleep(30)
|
||||
firstRun = False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user