work on crypto
parent
5564d540cb
commit
15aa395946
|
@ -46,6 +46,8 @@ class OnionrCommunicate:
|
||||||
blockProcessAmount = 5
|
blockProcessAmount = 5
|
||||||
heartBeatTimer = 0
|
heartBeatTimer = 0
|
||||||
heartBeatRate = 5
|
heartBeatRate = 5
|
||||||
|
pexTimer = 900 # How often we should check for new peers
|
||||||
|
pexCount = 0
|
||||||
logger.debug('Communicator debugging enabled.')
|
logger.debug('Communicator debugging enabled.')
|
||||||
torID = open('data/hs/hostname').read()
|
torID = open('data/hs/hostname').read()
|
||||||
|
|
||||||
|
|
|
@ -216,14 +216,23 @@ class Onionr:
|
||||||
'''
|
'''
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
peer = logger.readline('Peer to send to: ')
|
try:
|
||||||
if self.onionrUtils.validateID(peer):
|
peer = logger.readline('Peer to send to: ')
|
||||||
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
logger.error('Invalid peer ID')
|
if self.onionrUtils.validateID(peer):
|
||||||
message = logger.readline("Enter a message: ")
|
break
|
||||||
logger.info("Sending message to " + peer)
|
else:
|
||||||
self.onionrUtils.sendPM(peer, message)
|
logger.error('Invalid peer ID')
|
||||||
|
else:
|
||||||
|
try:
|
||||||
|
message = logger.readline("Enter a message: ")
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
logger.info("Sending message to " + peer)
|
||||||
|
self.onionrUtils.sendPM(peer, message)
|
||||||
|
|
||||||
|
|
||||||
def openGUI(self):
|
def openGUI(self):
|
||||||
|
|
|
@ -37,6 +37,10 @@ class OnionrUtils:
|
||||||
self._core = coreInstance
|
self._core = coreInstance
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def sendPM(self, user, message):
|
||||||
|
'''High level function to encrypt a message to a peer and insert it as a block'''
|
||||||
|
return
|
||||||
|
|
||||||
def localCommand(self, command):
|
def localCommand(self, command):
|
||||||
'''
|
'''
|
||||||
Send a command to the local http API server, securely. Intended for local clients, DO NOT USE for remote peers.
|
Send a command to the local http API server, securely. Intended for local clients, DO NOT USE for remote peers.
|
||||||
|
|
Loading…
Reference in New Issue