contrib/pylightning: allow getpeer with log level.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-04-29 10:32:27 +09:30
committed by Christian Decker
parent 366d67ae6d
commit be3b5f11e8

View File

@@ -78,10 +78,13 @@ class LightningRpc(UnixDomainSocketRpc):
between calls, but it does not (yet) support concurrent calls. between calls, but it does not (yet) support concurrent calls.
""" """
def getpeer(self, peer_id): def getpeer(self, peer_id, log_level=None):
"""Get info about a specific peer. """Get info about a specific peer, optionally with its log.
""" """
peers = self.getpeers()['peers'] if log_level:
peers = self.getpeers(log_level)['peers']
else:
peers = self.getpeers()['peers']
for p in peers: for p in peers:
if p['peerid'] == peer_id: if p['peerid'] == peer_id:
return p return p