trevert to daemon threads because some clients do not seem to close their sockets cleanly - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit 108dfb6140e1e273766bd96dc38e6df92161b425 DIR parent e766df1d3303236116722349e350c530f545a767 HTML Author: thomasv <thomasv@gitorious> Date: Wed, 5 Dec 2012 10:24:30 +0100 revert to daemon threads because some clients do not seem to close their sockets cleanly Diffstat: M electrum | 5 ++++- M lib/verifier.py | 2 +- M lib/wallet.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) --- DIR diff --git a/electrum b/electrum t@@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. import re -import sys, os +import sys, os, time import optparse try: t@@ -256,6 +256,9 @@ if __name__ == '__main__': synchronizer.stop() interface.stop() + # we use daemon threads, their termination is enforced. + # this sleep command gives them time to terminate cleanly. + time.sleep(0.1) sys.exit(0) if cmd not in known_commands: DIR diff --git a/lib/verifier.py b/lib/verifier.py t@@ -29,7 +29,7 @@ class WalletVerifier(threading.Thread): def __init__(self, interface, config): threading.Thread.__init__(self) - #self.daemon = True + self.daemon = True self.config = config self.interface = interface self.transactions = {} # requested verifications (with height sent by the requestor) DIR diff --git a/lib/wallet.py b/lib/wallet.py t@@ -1156,7 +1156,7 @@ class WalletSynchronizer(threading.Thread): def __init__(self, wallet, config): threading.Thread.__init__(self) - # self.daemon = True + self.daemon = True self.wallet = wallet self.interface = self.wallet.interface self.interface.register_channel('synchronizer')