fix peer_ping

This commit is contained in:
Victor Shyba 2018-08-10 18:13:37 -03:00 committed by Jack Robison
parent 95cb29d3c8
commit a32a0c6401
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -2640,7 +2640,7 @@ class Daemon(AuthJSONRPCServer):
peers = yield finished_deferred
results = [
{
"node_id": node_id.encode('hex'),
"node_id": hexlify(node_id).decode(),
"host": host,
"port": port
}
@ -2859,7 +2859,7 @@ class Daemon(AuthJSONRPCServer):
if not contact:
defer.returnValue({'error': 'peer not found'})
try:
result = yield contact.ping()
result = (yield contact.ping()).decode()
except TimeoutError:
result = {'error': 'ping timeout'}
defer.returnValue(result)