fix some CLI/RPC commands
This commit is contained in:
@@ -51,6 +51,7 @@ class Synchronizer(PrintError):
|
||||
'''
|
||||
def __init__(self, wallet):
|
||||
self.wallet = wallet
|
||||
self.network = wallet.network
|
||||
self.asyncio_loop = wallet.network.asyncio_loop
|
||||
self.requested_tx = {}
|
||||
self.requested_histories = {}
|
||||
@@ -86,7 +87,7 @@ class Synchronizer(PrintError):
|
||||
# request address history
|
||||
self.requested_histories[addr] = status
|
||||
h = address_to_scripthash(addr)
|
||||
result = await self.session.send_request("blockchain.scripthash.get_history", [h])
|
||||
result = await self.network.get_history_for_scripthash(h)
|
||||
self.print_error("receiving history", addr, len(result))
|
||||
hashes = set(map(lambda item: item['tx_hash'], result))
|
||||
hist = list(map(lambda item: (item['tx_hash'], item['height']), result))
|
||||
@@ -125,7 +126,7 @@ class Synchronizer(PrintError):
|
||||
await group.spawn(self._get_transaction, tx_hash)
|
||||
|
||||
async def _get_transaction(self, tx_hash):
|
||||
result = await self.session.send_request('blockchain.transaction.get', [tx_hash])
|
||||
result = await self.network.get_transaction(tx_hash)
|
||||
tx = Transaction(result)
|
||||
try:
|
||||
tx.deserialize()
|
||||
|
||||
Reference in New Issue
Block a user