From e62e9eb0bf8b4a8bd94ea381c947624f5c9b13f2 Mon Sep 17 00:00:00 2001 From: tecnovert Date: Thu, 30 May 2024 21:23:37 +0200 Subject: [PATCH] Reduce Decred log level and consider wallet blocks for verificationprogress. --- basicswap/interface/dcr/dcr.py | 11 ++++++++++- bin/basicswap_prepare.py | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/basicswap/interface/dcr/dcr.py b/basicswap/interface/dcr/dcr.py index bf1a1e9..27e4b9a 100644 --- a/basicswap/interface/dcr/dcr.py +++ b/basicswap/interface/dcr/dcr.py @@ -378,7 +378,16 @@ class DCRInterface(Secp256k1Interface): return self.rpc('getnetworkinfo')['version'] def getBlockchainInfo(self): - return self.rpc('getblockchaininfo') + bci = self.rpc('getblockchaininfo') + + # Adjust verificationprogress to consider blocks wallet has synced + wallet_blocks = self.rpc_wallet('getinfo')['blocks'] + synced_ind = bci['verificationprogress'] + wallet_synced_ind = wallet_blocks / bci['headers'] + if wallet_synced_ind < synced_ind: + bci['verificationprogress'] = wallet_synced_ind + + return bci def getWalletInfo(self): rv = {} diff --git a/bin/basicswap_prepare.py b/bin/basicswap_prepare.py index da7f253..5631882 100755 --- a/bin/basicswap_prepare.py +++ b/bin/basicswap_prepare.py @@ -931,7 +931,7 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}): with open(core_conf_path, 'w') as fp: if chain != 'mainnet': fp.write(chainname + '=1\n') - fp.write('debuglevel=debug\n') + fp.write('debuglevel=info\n') fp.write('notls=1\n') fp.write('rpclisten={}:{}\n'.format(core_settings['rpchost'], core_settings['rpcport'])) @@ -948,7 +948,7 @@ def prepareDataDir(coin, settings, chain, particl_mnemonic, extra_opts={}): with open(wallet_conf_path, 'w') as fp: if chain != 'mainnet': fp.write(chainname + '=1\n') - fp.write('debuglevel=debug\n') + fp.write('debuglevel=info\n') fp.write('noservertls=1\n') fp.write('noclienttls=1\n')