1
0

Make exchange rate plugin a network thread job

This fixes a lot of thread error noise when closing down electrum.
This commit is contained in:
Neil Booth
2015-08-31 19:21:42 +09:00
parent f5a8da43e9
commit a5e0265010
2 changed files with 27 additions and 30 deletions

View File

@@ -17,6 +17,7 @@ from bitcoin import *
from interface import Connection, Interface
from blockchain import Blockchain
from version import ELECTRUM_VERSION, PROTOCOL_VERSION
from plugins import run_hook
DEFAULT_PORTS = {'t':'50001', 's':'50002', 'h':'8081', 'g':'8082'}
@@ -132,7 +133,7 @@ class Network(util.DaemonThread):
- Member functions get_header(), get_interfaces(), get_local_height(),
get_parameters(), get_server_height(), get_status_value(),
is_connected(), new_blockchain_height(), set_parameters(), start(),
is_connected(), new_blockchain_height(), set_parameters(),
stop()
"""
@@ -750,6 +751,7 @@ class Network(util.DaemonThread):
self.process_responses(interface)
def run(self):
run_hook('set_network', self)
self.blockchain.init()
while self.is_running():
self.maintain_sockets()
@@ -759,6 +761,7 @@ class Network(util.DaemonThread):
self.process_pending_sends()
self.stop_network()
run_hook('set_network', None)
self.trigger_callback('stop')
self.print_error("stopped")