diff --git a/lbry/conf.py b/lbry/conf.py index 008742157..6945e537a 100644 --- a/lbry/conf.py +++ b/lbry/conf.py @@ -636,6 +636,7 @@ class Config(CLIConfig): "Strategy to use when selecting UTXOs for a transaction", STRATEGIES, "standard") + transaction_cache_size = Integer("Transaction cache size", 100_000) save_resolved_claims = Toggle( "Save content claims to the database when they are resolved to keep file_list up to date, " "only disable this if file_x commands are not needed", True diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index 56656ae4b..50adf7467 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -158,7 +158,7 @@ class Ledger(metaclass=LedgerRegistry): self._on_ready_controller = StreamController() self.on_ready = self._on_ready_controller.stream - self._tx_cache = pylru.lrucache(100000) + self._tx_cache = pylru.lrucache(self.config.get("tx_cache_size", 100_000)) self._update_tasks = TaskGroup() self._other_tasks = TaskGroup() # that we dont need to start self._utxo_reservation_lock = asyncio.Lock() diff --git a/lbry/wallet/manager.py b/lbry/wallet/manager.py index 20658a2e5..22f0e5d21 100644 --- a/lbry/wallet/manager.py +++ b/lbry/wallet/manager.py @@ -184,6 +184,7 @@ class WalletManager: 'auto_connect': True, 'default_servers': config.lbryum_servers, 'data_path': config.wallet_dir, + 'tx_cache_size': config.transaction_cache_size } wallets_directory = os.path.join(config.wallet_dir, 'wallets')