From f40f8dc49fd7fcebbaf6295bd8e867b94b75a154 Mon Sep 17 00:00:00 2001 From: Adam Gibson Date: Sun, 15 Mar 2020 16:07:22 +0000 Subject: [PATCH] Ensure correct chainparams for privkeys in Qt Since the chain parameters setting is thread-local, we must reapply it (for testing) in the show_privkeys thread (note, this is the only separate thread currently used in the Qt app, and there is none in the command line). --- scripts/joinmarket-qt.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/joinmarket-qt.py b/scripts/joinmarket-qt.py index 81254aff9..b71f2b8db 100644 --- a/scripts/joinmarket-qt.py +++ b/scripts/joinmarket-qt.py @@ -1452,6 +1452,12 @@ def exportPrivkeysJson(self): done = False def privkeys_thread(): + # To explain this (given setting was already done in + # load_program_config), see: + # https://github.com/Simplexum/python-bitcointx/blob/9f1fa67a5445f8c187ef31015a4008bc5a048eea/bitcointx/__init__.py#L242-L243 + # note, we ignore the return value as we only want to apply + # the chainparams setting logic: + get_blockchain_interface_instance(jm_single().config) for addr in addresses: time.sleep(0.1) if done: