(trivial) lnworker: move LNGossip.peer_closed to parent class

This commit is contained in:
SomberNight 2020-02-26 20:31:51 +01:00
parent 3d0c1dbd5c
commit 9d1fa4cc99
No known key found for this signature in database
GPG key ID: B33B5F232C6271E9

View file

@ -180,6 +180,9 @@ class LNWorker(Logger):
self.peers[node_id] = peer
return peer
def peer_closed(self, peer: Peer) -> None:
self.peers.pop(peer.pubkey)
def num_peers(self):
return sum([p.is_initialized() for p in self.peers.values()])
@ -349,9 +352,6 @@ class LNGossip(LNWorker):
self.network.trigger_callback('unknown_channels', len(self.unknown_ids))
return l[0:N]
def peer_closed(self, peer):
self.peers.pop(peer.pubkey)
class LNWallet(LNWorker):
@ -448,7 +448,7 @@ class LNWallet(LNWorker):
for chan in self.channels_for_peer(peer.pubkey).values():
chan.peer_state = peer_states.DISCONNECTED
self.network.trigger_callback('channel', chan)
self.peers.pop(peer.pubkey)
super().peer_closed(peer)
def get_channel_status(self, chan):
# status displayed in the GUI