Move callback manager out of Network class
This commit is contained in:
@@ -30,6 +30,7 @@ import logging
|
||||
|
||||
from aiorpcx import TaskGroup, run_in_thread, RPCError
|
||||
|
||||
from . import util
|
||||
from .transaction import Transaction, PartialTransaction
|
||||
from .util import bh2u, make_aiohttp_session, NetworkJobOnDefaultServer
|
||||
from .bitcoin import address_to_scripthash, is_address
|
||||
@@ -227,7 +228,7 @@ class Synchronizer(SynchronizerBase):
|
||||
self.wallet.receive_tx_callback(tx_hash, tx, tx_height)
|
||||
self.logger.info(f"received tx {tx_hash} height: {tx_height} bytes: {len(raw_tx)}")
|
||||
# callbacks
|
||||
self.wallet.network.trigger_callback('new_transaction', self.wallet, tx)
|
||||
util.trigger_callback('new_transaction', self.wallet, tx)
|
||||
|
||||
async def main(self):
|
||||
self.wallet.set_up_to_date(False)
|
||||
@@ -252,7 +253,7 @@ class Synchronizer(SynchronizerBase):
|
||||
if up_to_date:
|
||||
self._reset_request_counters()
|
||||
self.wallet.set_up_to_date(up_to_date)
|
||||
self.wallet.network.trigger_callback('wallet_updated', self.wallet)
|
||||
util.trigger_callback('wallet_updated', self.wallet)
|
||||
|
||||
|
||||
class Notifier(SynchronizerBase):
|
||||
|
||||
Reference in New Issue
Block a user