本文整理汇总了Python中electrum.wallet.Wallet.stop_threads方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.stop_threads方法的具体用法?Python Wallet.stop_threads怎么用?Python Wallet.stop_threads使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类electrum.wallet.Wallet
的用法示例。
在下文中一共展示了Wallet.stop_threads方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from electrum.wallet import Wallet [as 别名]
# 或者: from electrum.wallet.Wallet import stop_threads [as 别名]
class ElectrumGui:
def __init__(self, config, network):
self.network = network
self.config = config
storage = WalletStorage(self.config.get_wallet_path())
if not storage.file_exists:
raise BaseException("Wallet not found")
self.wallet = Wallet(storage)
self.cmd_runner = Commands(self.config, self.wallet, self.network)
host = config.get('rpchost', 'localhost')
port = config.get('rpcport', 7777)
self.server = SimpleJSONRPCServer((host, port), requestHandler=RequestHandler)
self.server.socket.settimeout(1)
for cmdname in known_commands:
self.server.register_function(getattr(self.cmd_runner, cmdname), cmdname)
def main(self, url):
self.wallet.start_threads(self.network)
while True:
try:
self.server.handle_request()
except socket.timeout:
continue
except:
break
self.wallet.stop_threads()