diff --git a/electrumx_rpc.py b/electrumx_rpc.py index 0e008f3..9d3a9c2 100755 --- a/electrumx_rpc.py +++ b/electrumx_rpc.py @@ -48,8 +48,8 @@ class RPCClient(asyncio.Protocol): fmt = '{:<4} {:>23} {:>7} {:>15} {:>7}' print(fmt.format('Type', 'Peer', 'Subs', 'Client', 'Time')) for kind, peer, subs, client, time in result: - print(fmt.format(kind, peer, '{:,d}'.format(subs) - client, '{:,d}'.format(int(time))) + print(fmt.format(kind, peer, '{:,d}'.format(subs), + client, '{:,d}'.format(int(time)))) else: pprint.pprint(result, indent=4) diff --git a/server/block_processor.py b/server/block_processor.py index c595fd6..28d067c 100644 --- a/server/block_processor.py +++ b/server/block_processor.py @@ -692,12 +692,12 @@ class BlockProcessor(server.db.DB): db_cache_size = len(self.db_cache) * 105 hist_cache_size = len(self.history) * 180 + self.history_size * 4 tx_hash_size = (self.tx_count - self.db_tx_count) * 74 - utxo_MB = (db_deletes_size + utxo_cache_size + tx_hash_size) // one_MB + utxo_MB = (db_cache_size + utxo_cache_size + tx_hash_size) // one_MB hist_MB = hist_cache_size // one_MB self.logger.info('UTXOs: {:,d} deletes: {:,d} ' 'UTXOs {:,d}MB hist {:,d}MB' - .format(len(self.utxo_cache), len(self.db_deletes), + .format(len(self.utxo_cache), self.db_deletes, utxo_MB, hist_MB)) self.logger.info('our height: {:,d} daemon height: {:,d}' .format(self.height, self.daemon.cached_height())) @@ -990,7 +990,7 @@ class BlockProcessor(server.db.DB): 'DB spends: {:,d}' .format(len(self.utxo_cache) + self.utxo_cache_spends, self.utxo_cache_spends, - len(self.db_deletes) // 2)) + self.db_deletes)) fs_flush_start = time.time() self.fs_flush() diff --git a/server/protocol.py b/server/protocol.py index 9c2c6ad..eacf0a7 100644 --- a/server/protocol.py +++ b/server/protocol.py @@ -43,7 +43,7 @@ class BlockServer(BlockProcessor): self.irc = IRC(env) async def caught_up(self, mempool_hashes): - await super().caught_up(mempool_hashes) + await super().caught_up([]) #mempool_hashes) if not self.servers: await self.start_servers() if self.env.irc: @@ -632,8 +632,9 @@ class LocalRPC(JSONRPC): async def sessions(self, params): now = time.time() - return [(session.kind, session.peername, len(session.hash168s), - session.client, now - session.start) + return [(session.kind, + 'this RPC client' if session == self else session.peername, + len(session.hash168s), session.client, now - session.start) for session in self.SESSION_MGR.sessions] async def numsessions(self, params):