Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions chia/full_node/coin_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,21 @@ async def new_block(
await self._set_spent(tx_removals, height)

end = time.monotonic()
log.log(
logging.WARNING if end - start > 10 else logging.DEBUG,
took_too_long = end - start > 10

message = (
f"Height {height}: It took {end - start:0.2f}s to apply {len(tx_additions)} additions and "
+ f"{len(tx_removals)} removals to the coin store. Make sure "
+ "blockchain database is on a fast drive",
+ f"{len(tx_removals)} removals to the coin store."
)

if took_too_long:
level = logging.WARNING
message += " Make sure blockchain database is on a fast drive"
else:
level = logging.DEBUG

log.log(level, message)

# Checks DB and DiffStores for CoinRecord with coin_name and returns it
async def get_coin_record(self, coin_name: bytes32) -> Optional[CoinRecord]:
async with self.db_wrapper.reader_no_transaction() as conn:
Expand Down
Loading