Browse Source

Merge #478: Add 'no-blockchain' blockchain_source option.

8ae41b1 noblockchain error message for Qt (Adam Gibson)
931a5c8 Add 'no-blockchain' blockchain_source option. (Adam Gibson)
master
Adam Gibson 6 years ago
parent
commit
0746423a3c
No known key found for this signature in database
GPG Key ID: 141001A1AF77F20B
  1. 13
      jmclient/jmclient/configure.py
  2. 9
      scripts/joinmarket-qt.py

13
jmclient/jmclient/configure.py

@ -107,9 +107,13 @@ daemon_host = localhost
use_ssl = false
[BLOCKCHAIN]
#options: bitcoin-rpc, regtest, bitcoin-rpc-no-history
# when using bitcoin-rpc-no-history remember to increase the gap limit to scan for more addresses, try -g 5000
# options: bitcoin-rpc, regtest, bitcoin-rpc-no-history, no-blockchain
# When using bitcoin-rpc-no-history remember to increase the gap limit to scan for more addresses, try -g 5000
# Use 'no-blockchain' to run the ob-watcher.py script in scripts/obwatch without current access
# to Bitcoin Core; note that use of this option for any other purpose is currently unsupported.
blockchain_source = bitcoin-rpc
# options: testnet, mainnet
# Note: for regtest, use network = testnet
network = mainnet
rpc_host = localhost
rpc_port = 8332
@ -528,7 +532,6 @@ def get_blockchain_interface_instance(_config):
from jmclient.blockchaininterface import BitcoinCoreInterface, \
RegtestBitcoinCoreInterface, ElectrumWalletInterface, \
BitcoinCoreNoHistoryInterface
from jmclient.electruminterface import ElectrumInterface
source = _config.get("BLOCKCHAIN", "blockchain_source")
network = get_network()
testnet = network == 'testnet'
@ -549,8 +552,8 @@ def get_blockchain_interface_instance(_config):
assert 0
elif source == 'electrum':
bc_interface = ElectrumWalletInterface(testnet)
elif source == 'electrum-server':
bc_interface = ElectrumInterface(testnet) #can specify server, config, TODO
elif source == 'no-blockchain':
bc_interface = None
else:
raise ValueError("Invalid blockchain source")
return bc_interface

9
scripts/joinmarket-qt.py

@ -1818,6 +1818,15 @@ except Exception as e:
])
JMQtMessageBox(None, config_load_error, mbtype='crit', title='failed to load')
exit(1)
# Qt does not currently support any functioning without a Core interface:
if jm_single().bc_interface is None:
blockchain_error = ''.join(["Joinmarket-Qt requires Bitcoin Core as a blockchain ",
"interface; change the setting of 'blockchain_source' ",
"in the joinmarket.cfg file to a value not equal to ",
"'no-blockchain'; see comments for details."])
JMQtMessageBox(None, blockchain_error, mbtype='crit',
title='Invalid blockchain source')
exit(1)
#refuse to load non-segwit wallet (needs extra work in wallet-utils).
if not jm_single().config.get("POLICY", "segwit") == "true":
wallet_load_error = ''.join(["Joinmarket-Qt only supports segwit based wallets, ",

Loading…
Cancel
Save