1
0

logging: eliminate "fee_estimates" log spam

only log fee estimates if they changed, instead of ~10 times per minute
This commit is contained in:
SomberNight
2021-02-27 12:27:26 +01:00
parent 7f61f22857
commit d85e910262

View File

@@ -36,6 +36,7 @@ from typing import NamedTuple, Optional, Sequence, List, Dict, Tuple, TYPE_CHECK
import traceback
import concurrent
from concurrent import futures
import copy
import aiorpcx
from aiorpcx import TaskGroup
@@ -531,7 +532,9 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
e = self.get_fee_estimates()
for nblock_target, fee in e.items():
self.config.update_fee_estimates(nblock_target, fee)
self.logger.info(f'fee_estimates {e}')
if not hasattr(self, "_prev_fee_est") or self._prev_fee_est != e:
self._prev_fee_est = copy.copy(e)
self.logger.info(f'fee_estimates {e}')
self.notify('fee')
@with_recent_servers_lock