@staticmethod<EOL><INDENT>def broadcast_tx_with_chain(tx, bitcoin_chain, bitcoind=False):<DEDENT>
last_exception = None<EOL>final_tx_id = None<EOL>for attempt_number in range(<NUM_LIT:0>, MAX_BROADCAST_ATTEMPTS):<EOL><INDENT>for method_provider in service_provider_methods('<STR_LIT>',<EOL>get_providers_for_chain(bitcoin_chain, bitcoind)):<EOL><INDENT>try:<EOL><INDENT>tx_id = method_provider(tx)<EOL>if tx_id:<EOL><INDENT>logging.info('<STR_LIT>', str(method_provider),<EOL>tx_id)<EOL>if final_tx_id and final_tx_id != tx_id:<EOL><INDENT>logging.error(<EOL>'<STR_LIT>',<EOL>final_tx_id, tx_id, tx.as_hex())<EOL>raise Exception('<STR_LIT>')<EOL><DEDENT>final_tx_id = tx_id<EOL><DEDENT><DEDENT>except Exception as e:<EOL><INDENT>logging.warning('<STR_LIT>',<EOL>str(method_provider), e)<EOL>last_exception = e<EOL><DEDENT><DEDENT>if final_tx_id:<EOL><INDENT>return final_tx_id<EOL><DEDENT>else:<EOL><INDENT>logging.warning('<STR_LIT>',<EOL>attempt_number)<EOL>time.sleep(BROADCAST_RETRY_INTERVAL)<EOL><DEDENT><DEDENT>logging.error('<STR_LIT>')<EOL>logging.error(last_exception, exc_info=True)<EOL>raise BroadcastError(last_exception)<EOL>
Broadcast the transaction through the configured set of providers

:param tx:
:param bitcoin_chain:
:return: