diff --git a/jmclient/jmclient/__init__.py b/jmclient/jmclient/__init__.py index 34ab45f..489c749 100644 --- a/jmclient/jmclient/__init__.py +++ b/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 diff --git a/jmclient/jmclient/configure.py b/jmclient/jmclient/configure.py index 78c965c..669ec11 100644 --- a/jmclient/jmclient/configure.py +++ b/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),