kivy: add "clear all gossip" button in ln gossip dialog
One usecase is perhaps to save space if using trampoline anyway... more importantly, if using gossip, LNGossip is heavily filtering what messages we request and get, and e.g. can missing new NodeAnnouncements, etc, and this is a quick-and-dirty workaround to force a fresh start.
This commit is contained in:
@@ -51,6 +51,7 @@ if TYPE_CHECKING:
|
||||
from .network import Network
|
||||
from .lnchannel import Channel
|
||||
from .lnrouter import RouteEdge
|
||||
from .simple_config import SimpleConfig
|
||||
|
||||
|
||||
FLAG_DISABLE = 1 << 1
|
||||
@@ -304,7 +305,7 @@ class ChannelDB(SqlDB):
|
||||
NUM_MAX_RECENT_PEERS = 20
|
||||
|
||||
def __init__(self, network: 'Network'):
|
||||
path = os.path.join(get_headers_dir(network.config), 'gossip_db')
|
||||
path = self.get_file_path(network.config)
|
||||
super().__init__(network.asyncio_loop, path, commit_interval=100)
|
||||
self.lock = threading.RLock()
|
||||
self.num_nodes = 0
|
||||
@@ -328,6 +329,10 @@ class ChannelDB(SqlDB):
|
||||
self.data_loaded = asyncio.Event()
|
||||
self.network = network # only for callback
|
||||
|
||||
@classmethod
|
||||
def get_file_path(cls, config: 'SimpleConfig') -> str:
|
||||
return os.path.join(get_headers_dir(config), 'gossip_db')
|
||||
|
||||
def update_counts(self):
|
||||
self.num_nodes = len(self._nodes)
|
||||
self.num_channels = len(self._channels)
|
||||
|
||||
Reference in New Issue
Block a user