File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -154,13 +154,21 @@ async def new_block(
154
154
await self ._set_spent (tx_removals , height )
155
155
156
156
end = time .monotonic ()
157
- log .log (
158
- logging .WARNING if end - start > 10 else logging .DEBUG ,
157
+ took_too_long = end - start > 10
158
+
159
+ message = (
159
160
f"Height { height } : It took { end - start :0.2f} s to apply { len (tx_additions )} additions and "
160
- + f"{ len (tx_removals )} removals to the coin store. Make sure "
161
- + "blockchain database is on a fast drive" ,
161
+ + f"{ len (tx_removals )} removals to the coin store."
162
162
)
163
163
164
+ if took_too_long :
165
+ level = logging .WARNING
166
+ message += " Make sure blockchain database is on a fast drive"
167
+ else :
168
+ level = logging .DEBUG
169
+
170
+ log .log (level , message )
171
+
164
172
# Checks DB and DiffStores for CoinRecord with coin_name and returns it
165
173
async def get_coin_record (self , coin_name : bytes32 ) -> Optional [CoinRecord ]:
166
174
async with self .db_wrapper .reader_no_transaction () as conn :
You can’t perform that action at this time.
0 commit comments