Browse Source

add is_segwit_mode() utility function

master
undeath 8 years ago
parent
commit
8b9abef4fb
  1. 2
      jmclient/jmclient/__init__.py
  2. 4
      jmclient/jmclient/configure.py

2
jmclient/jmclient/__init__.py

@ -26,7 +26,7 @@ from .cryptoengine import BTCEngine, BTC_P2PKH, BTC_P2SH_P2WPKH, EngineError
from .configure import (
load_program_config, get_p2pk_vbyte, jm_single, get_network,
validate_address, get_irc_mchannels, get_blockchain_interface_instance,
get_p2sh_vbyte, set_config)
get_p2sh_vbyte, set_config, is_segwit_mode)
from .blockchaininterface import (BlockchainInterface, sync_wallet,
RegtestBitcoinCoreInterface, BitcoinCoreInterface)
from .electruminterface import ElectrumInterface

4
jmclient/jmclient/configure.py

@ -414,3 +414,7 @@ def get_blockchain_interface_instance(_config):
else:
raise ValueError("Invalid blockchain source")
return bc_interface
def is_segwit_mode():
return jm_single().config.get('POLICY', 'segwit') != 'false'

Loading…
Cancel
Save