Browse Source

jm_wallet: do not process events on inactive plugin

add-joinmarket
zebra-lucky 1 year ago
parent
commit
d78106be71
  1. 6
      electrum/plugins/joinmarket/jm_wallet.py

6
electrum/plugins/joinmarket/jm_wallet.py

@ -559,6 +559,8 @@ class JMWallet(KeyPairsMixin, WalletDBMixin, JMBaseCodeMixin, EventListener):
@event_listener @event_listener
async def on_event_adb_added_tx(self, adb, txid: str, tx: Transaction): async def on_event_adb_added_tx(self, adb, txid: str, tx: Transaction):
if not self.jmman.enabled:
return
if self.wallet.adb != adb: if self.wallet.adb != adb:
return return
try: try:
@ -568,6 +570,8 @@ class JMWallet(KeyPairsMixin, WalletDBMixin, JMBaseCodeMixin, EventListener):
@event_listener @event_listener
async def on_event_adb_added_verified_tx(self, adb, txid): async def on_event_adb_added_verified_tx(self, adb, txid):
if not self.jmman.enabled:
return
if self.wallet.adb != adb: if self.wallet.adb != adb:
return return
try: try:
@ -583,6 +587,8 @@ class JMWallet(KeyPairsMixin, WalletDBMixin, JMBaseCodeMixin, EventListener):
@event_listener @event_listener
async def on_event_adb_tx_height_changed(self, adb, txid, async def on_event_adb_tx_height_changed(self, adb, txid,
old_height, tx_height): old_height, tx_height):
if not self.jmman.enabled:
return
if self.wallet.adb != adb: if self.wallet.adb != adb:
return return
try: try:

Loading…
Cancel
Save