Browse Source

allow config,bci injection by client packages

master
Adam Gibson 9 years ago
parent
commit
099227b3c7
No known key found for this signature in database
GPG Key ID: B3AE09F1E9A3197A
  1. 3
      jmclient/jmclient/__init__.py
  2. 7
      jmclient/jmclient/configure.py

3
jmclient/jmclient/__init__.py

@ -21,7 +21,8 @@ from .wallet import (AbstractWallet, BitcoinCoreInterface, Wallet,
create_wallet_file)
from .configure import (load_program_config, jm_single, get_p2pk_vbyte,
get_network, jm_single, get_network, validate_address, get_irc_mchannels,
check_utxo_blacklist, get_blockchain_interface_instance, get_p2sh_vbyte)
check_utxo_blacklist, get_blockchain_interface_instance, get_p2sh_vbyte,
set_config)
from .blockchaininterface import (BlockrInterface, BlockchainInterface, sync_wallet,
RegtestBitcoinCoreInterface, BitcoinCoreInterface)
from .electruminterface import ElectrumInterface

7
jmclient/jmclient/configure.py

@ -205,6 +205,13 @@ accept_commitment_broadcasts = 1
commit_file_location = cmtdata/commitments.json
"""
#This allows use of the jmclient package with a
#configuration set by an external caller; not to be used
#in conjuction with calls to load_program_config.
def set_config(cfg, bcint=None):
global_singleton.config = cfg
if bcint:
global_singleton.bc_interface = bcint
def get_irc_mchannels():
fields = [("host", str), ("port", int), ("channel", str), ("usessl", str),

Loading…
Cancel
Save