aiorpcx: remove callback based code, add session to Interface
This commit is contained in:
@@ -15,6 +15,7 @@ from electrum.util import profiler, InvalidPassword
|
||||
from electrum.plugin import run_hook
|
||||
from electrum.util import format_satoshis, format_satoshis_plain
|
||||
from electrum.paymentrequest import PR_UNPAID, PR_PAID, PR_UNKNOWN, PR_EXPIRED
|
||||
from electrum import blockchain
|
||||
from .i18n import _
|
||||
|
||||
from kivy.app import App
|
||||
@@ -114,10 +115,10 @@ class ElectrumWindow(App):
|
||||
from .uix.dialogs.choice_dialog import ChoiceDialog
|
||||
chains = self.network.get_blockchains()
|
||||
def cb(name):
|
||||
for index, b in self.network.blockchains.items():
|
||||
for index, b in blockchain.blockchains.items():
|
||||
if name == b.get_name():
|
||||
self.network.follow_chain(index)
|
||||
names = [self.network.blockchains[b].get_name() for b in chains]
|
||||
names = [blockchain.blockchains[b].get_name() for b in chains]
|
||||
if len(names) > 1:
|
||||
cur_chain = self.network.blockchain().get_name()
|
||||
ChoiceDialog(_('Choose your chain'), names, cur_chain, cb).open()
|
||||
|
||||
@@ -31,7 +31,7 @@ from PyQt5.QtWidgets import *
|
||||
import PyQt5.QtCore as QtCore
|
||||
|
||||
from electrum.i18n import _
|
||||
from electrum import constants
|
||||
from electrum import constants, blockchain
|
||||
from electrum.util import print_error
|
||||
from electrum.network import serialize_server, deserialize_server
|
||||
|
||||
@@ -103,7 +103,7 @@ class NodesListWidget(QTreeWidget):
|
||||
chains = network.get_blockchains()
|
||||
n_chains = len(chains)
|
||||
for k, items in chains.items():
|
||||
b = network.blockchains[k]
|
||||
b = blockchain.blockchains[k]
|
||||
name = b.get_name()
|
||||
if n_chains >1:
|
||||
x = QTreeWidgetItem([name + '@%d'%b.get_forkpoint(), '%d'%b.height()])
|
||||
|
||||
Reference in New Issue
Block a user