Browse Source

channel_db: (fix) asyncio.Event.set() is not thread-safe

it must be called from asyncio thread
patch-4
SomberNight 4 years ago
parent
commit
7243e5b763
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      electrum/channel_db.py

2
electrum/channel_db.py

@ -721,7 +721,7 @@ class ChannelDB(SqlDB):
(nchans_with_0p, nchans_with_1p, nchans_with_2p) = self.get_num_channels_partitioned_by_policy_count() (nchans_with_0p, nchans_with_1p, nchans_with_2p) = self.get_num_channels_partitioned_by_policy_count()
self.logger.info(f'num_channels_partitioned_by_policy_count. ' self.logger.info(f'num_channels_partitioned_by_policy_count. '
f'0p: {nchans_with_0p}, 1p: {nchans_with_1p}, 2p: {nchans_with_2p}') f'0p: {nchans_with_0p}, 1p: {nchans_with_1p}, 2p: {nchans_with_2p}')
self.data_loaded.set() self.asyncio_loop.call_soon_threadsafe(self.data_loaded.set)
util.trigger_callback('gossip_db_loaded') util.trigger_callback('gossip_db_loaded')
def _update_num_policies_for_chan(self, short_channel_id: ShortChannelID) -> None: def _update_num_policies_for_chan(self, short_channel_id: ShortChannelID) -> None:

Loading…
Cancel
Save