diff --git a/lbry/conf.py b/lbry/conf.py index 8b39570a1..969153c58 100644 --- a/lbry/conf.py +++ b/lbry/conf.py @@ -627,6 +627,10 @@ class Config(CLIConfig): "only disable this if file_x commands are not needed", True ) + skip_transaction_verification = Toggle( + "Enable to skip transaction verification if you trust the wallet server you are connected to", False + ) + @property def streaming_host(self): return self.streaming_server.split(':')[0] diff --git a/lbry/wallet/ledger.py b/lbry/wallet/ledger.py index feef913b5..be27d4a81 100644 --- a/lbry/wallet/ledger.py +++ b/lbry/wallet/ledger.py @@ -567,7 +567,7 @@ class Ledger(metaclass=LedgerRegistry): cache_item = self._tx_cache[txid] = TransactionCacheItem() elif cache_item.tx is not None and \ cache_item.tx.height >= remote_height and \ - (cache_item.tx.is_verified or remote_height < 1): + (cache_item.tx.is_verified or self.config.get('skip_transaction_verification') or remote_height < 1): return cache_item.tx # cached tx is already up-to-date async with cache_item.lock: @@ -589,6 +589,8 @@ class Ledger(metaclass=LedgerRegistry): async def maybe_verify_transaction(self, tx, remote_height): tx.height = remote_height + if self.config.get("skip_transaction_verification"): + return if 0 < remote_height < len(self.headers): merkle = await self.network.retriable_call(self.network.get_merkle, tx.id, remote_height) merkle_root = self.get_root_of_merkle_tree(merkle['merkle'], merkle['pos'], tx.hash) diff --git a/lbry/wallet/manager.py b/lbry/wallet/manager.py index 6e8cc5db1..9d7b7bd1e 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, + 'skip_transaction_verification': config.skip_transaction_verification, } wallets_directory = os.path.join(config.wallet_dir, 'wallets')