def send_txs_and_test(self, txs, rpc, success=True, expect_disconnect=False, reject_code=None, reject_reason=None):
    "Send txs to test node and test whether they're accepted to the mempool.\n\n         - add all txs to our tx_store\n         - send tx messages for all txs\n         - if success is True/False: assert that the txs are/are not accepted to the mempool\n         - if expect_disconnect is True: Skip the sync with ping\n         - if reject_code and reject_reason are set: assert that the correct reject message is received."
    with mininode_lock:
        self.reject_code_received = None
        self.reject_reason_received = None
        for tx in txs:
            self.tx_store[tx.sha256] = tx
    for tx in txs:
        self.send_message(msg_tx(tx))
    if expect_disconnect:
        self.wait_for_disconnect()
    else:
        self.sync_with_ping()
    raw_mempool = rpc.getrawmempool()
    if success:
        for tx in txs:
            assert (tx.hash in raw_mempool), '{} not found in mempool'.format(tx.hash)
    else:
        for tx in txs:
            assert (tx.hash not in raw_mempool), '{} tx found in mempool'.format(tx.hash)
    if (reject_code is not None):
        wait_until((lambda : (self.reject_code_received == reject_code)), lock=mininode_lock)
    if (reject_reason is not None):
        wait_until((lambda : (self.reject_reason_received == reject_reason)), lock=mininode_lock)
Send txs to test node and test whether they're accepted to the mempool.

- add all txs to our tx_store
- send tx messages for all txs
- if success is True/False: assert that the txs are/are not accepted to the mempool
- if expect_disconnect is True: Skip the sync with ping
- if reject_code and reject_reason are set: assert that the correct reject message is received.
def send_txs_and_test(self, txs, rpc, success=True, expect_disconnect=False, reject_code=None, reject_reason=None):
    "Send txs to test node and test whether they're accepted to the mempool.\n\n         - add all txs to our tx_store\n         - send tx messages for all txs\n         - if success is True/False: assert that the txs are/are not accepted to the mempool\n         - if expect_disconnect is True: Skip the sync with ping\n         - if reject_code and reject_reason are set: assert that the correct reject message is received."
    with mininode_lock:
        self.reject_code_received = None
        self.reject_reason_received = None
        for tx in txs:
            self.tx_store[tx.sha256] = tx
    for tx in txs:
        self.send_message(msg_tx(tx))
    if expect_disconnect:
        self.wait_for_disconnect()
    else:
        self.sync_with_ping()
    raw_mempool = rpc.getrawmempool()
    if success:
        for tx in txs:
            assert (tx.hash in raw_mempool), '{} not found in mempool'.format(tx.hash)
    else:
        for tx in txs:
            assert (tx.hash not in raw_mempool), '{} tx found in mempool'.format(tx.hash)
    if (reject_code is not None):
        wait_until((lambda : (self.reject_code_received == reject_code)), lock=mininode_lock)
    if (reject_reason is not None):
        wait_until((lambda : (self.reject_reason_received == reject_reason)), lock=mininode_lock)