Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

Commit

Permalink
ixje feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
localhuman committed Sep 18, 2018
1 parent bb0ce63 commit 0a93ba7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
14 changes: 2 additions & 12 deletions neo/Network/NeoNode.py
Expand Up @@ -268,7 +268,7 @@ def OnLoopError(self, err):
self.Log("On neo Node loop error %s " % err)

def onThreadDeferredErr(self, err):
self.Log("On Call from thread earr %s " % err)
self.Log("On Call from thread error %s " % err)

def ProtocolReady(self):
self.RequestPeerInfo()
Expand All @@ -284,8 +284,6 @@ def ProtocolReady(self):
peerLoopDeferred.addErrback(self.OnLoopError)

def AskForMoreHeaders(self):
# self.Log("asking for more headers...")

get_headers_message = Message("getheaders", GetBlocksPayload(hash_start=[BC.Default().CurrentHeaderHash]))
self.SendSerializedMessage(get_headers_message)

Expand All @@ -302,7 +300,6 @@ def AskForMoreBlocks(self):

if self.sync_mode != current_mode:
self.block_loop.stop()
# self.Log("Changing sync mode from %s to %s" % (current_mode, self.sync_mode))
self.block_loop.start(self.sync_mode)
else:
if len(BC.Default().BlockRequests) > self.leader.BREQMAX:
Expand Down Expand Up @@ -378,7 +375,6 @@ def SendPeerInfo(self):

def RequestVersion(self):
"""Request the remote client version."""
# self.Log("All caught up, requesting version")
m = Message("getversion")
self.SendSerializedMessage(m)

Expand Down Expand Up @@ -448,11 +444,6 @@ def HandleInvMessage(self, payload):
elif inventory.Type == InventoryType.ConsensusInt:
pass

# for hash in inventory.Hashes:
# if not hash in self.leader.KnownHashes:
# if not hash in self.leader.MissionsGlobal:
# self.leader.MissionsGlobal.append(hash)

def SendSerializedMessage(self, message):
"""
Send the `message` to the remote client.
Expand All @@ -466,7 +457,7 @@ def SendSerializedMessage(self, message):
self.bytes_out += len(ba2)
self.transport.write(ba2)
except Exception as e:
self.Log("Could not send serialiized message %s " % e)
self.Log("Could not send serialized message %s " % e)

def HandleBlockHeadersReceived(self, inventory):
"""
Expand All @@ -477,7 +468,6 @@ def HandleBlockHeadersReceived(self, inventory):
"""
try:
inventory = IOHelper.AsSerializableWithType(inventory, 'neo.Network.Payloads.HeadersPayload.HeadersPayload')
# self.Log("Received headers %s " % ([h.Hash.ToBytes() for h in inventory.Headers]))
if inventory is not None:
BC.Default().AddHeaders(inventory.Headers)

Expand Down
5 changes: 2 additions & 3 deletions neo/Network/NodeLeader.py
Expand Up @@ -168,7 +168,7 @@ def SetupConnection(self, host, port):
try:
reactor.connectTCP(host, int(port), NeoClientFactory(), timeout=120)
except Exception as e:
print("Could not connect TCP to %s:%s " % (host, port))
logger.debug("Could not connect TCP to %s:%s " % (host, port))

def Shutdown(self):
"""Disconnect all connected peers."""
Expand Down Expand Up @@ -212,7 +212,7 @@ def RemoveConnectedPeer(self, peer):
self.Peers.remove(peer)

def onSetupConnectionErr(self, err):
print("On setup connectioin error! %s" % err)
logger.debug("On setup connectioin error! %s" % err)

def PeerCheckLoop(self):
# often times things will get stuck on 1 peer so
Expand Down Expand Up @@ -326,7 +326,6 @@ def Relay(self, inventory):
pass

relayed = self.RelayDirectly(inventory)
# self.
return relayed

def GetTransaction(self, hash):
Expand Down

0 comments on commit 0a93ba7

Please sign in to comment.