def run_test(self):
    self.segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
    self.old_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=1), services=NODE_NETWORK)
    self.additional_segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
    self.make_utxos()
    assert softfork_active(self.nodes[0], 'segwit')
    self.log.info('Testing SENDCMPCT p2p message... ')
    self.test_sendcmpct(self.segwit_node, old_node=self.old_node)
    self.test_sendcmpct(self.additional_segwit_node)
    self.log.info('Testing compactblock construction...')
    self.test_compactblock_construction(self.old_node)
    self.test_compactblock_construction(self.segwit_node)
    self.log.info('Testing compactblock requests (segwit node)... ')
    self.test_compactblock_requests(self.segwit_node)
    self.log.info('Testing getblocktxn requests (segwit node)...')
    self.test_getblocktxn_requests(self.segwit_node)
    self.log.info('Testing getblocktxn handler (segwit node should return witnesses)...')
    self.test_getblocktxn_handler(self.segwit_node)
    self.test_getblocktxn_handler(self.old_node)
    self.log.info('Testing compactblock requests/announcements not at chain tip...')
    self.test_compactblocks_not_at_tip(self.segwit_node)
    self.test_compactblocks_not_at_tip(self.old_node)
    self.log.info('Testing handling of incorrect blocktxn responses...')
    self.test_incorrect_blocktxn_response(self.segwit_node)
    self.log.info('Testing reconstructing compact blocks from all peers...')
    self.test_compactblock_reconstruction_multiple_peers(self.segwit_node, self.additional_segwit_node)
    self.log.info('Testing end-to-end block relay...')
    self.request_cb_announcements(self.old_node)
    self.request_cb_announcements(self.segwit_node)
    self.test_end_to_end_block_relay([self.segwit_node, self.old_node])
    self.log.info('Testing handling of invalid compact blocks...')
    self.test_invalid_tx_in_compactblock(self.segwit_node)
    self.test_invalid_tx_in_compactblock(self.old_node)
    self.log.info('Testing invalid index in cmpctblock message...')
    self.test_invalid_cmpctblock_message()
def run_test(self):
    self.segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
    self.old_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=1), services=NODE_NETWORK)
    self.additional_segwit_node = self.nodes[0].add_p2p_connection(TestP2PConn(cmpct_version=2))
    self.make_utxos()
    assert softfork_active(self.nodes[0], 'segwit')
    self.log.info('Testing SENDCMPCT p2p message... ')
    self.test_sendcmpct(self.segwit_node, old_node=self.old_node)
    self.test_sendcmpct(self.additional_segwit_node)
    self.log.info('Testing compactblock construction...')
    self.test_compactblock_construction(self.old_node)
    self.test_compactblock_construction(self.segwit_node)
    self.log.info('Testing compactblock requests (segwit node)... ')
    self.test_compactblock_requests(self.segwit_node)
    self.log.info('Testing getblocktxn requests (segwit node)...')
    self.test_getblocktxn_requests(self.segwit_node)
    self.log.info('Testing getblocktxn handler (segwit node should return witnesses)...')
    self.test_getblocktxn_handler(self.segwit_node)
    self.test_getblocktxn_handler(self.old_node)
    self.log.info('Testing compactblock requests/announcements not at chain tip...')
    self.test_compactblocks_not_at_tip(self.segwit_node)
    self.test_compactblocks_not_at_tip(self.old_node)
    self.log.info('Testing handling of incorrect blocktxn responses...')
    self.test_incorrect_blocktxn_response(self.segwit_node)
    self.log.info('Testing reconstructing compact blocks from all peers...')
    self.test_compactblock_reconstruction_multiple_peers(self.segwit_node, self.additional_segwit_node)
    self.log.info('Testing end-to-end block relay...')
    self.request_cb_announcements(self.old_node)
    self.request_cb_announcements(self.segwit_node)
    self.test_end_to_end_block_relay([self.segwit_node, self.old_node])
    self.log.info('Testing handling of invalid compact blocks...')
    self.test_invalid_tx_in_compactblock(self.segwit_node)
    self.test_invalid_tx_in_compactblock(self.old_node)
    self.log.info('Testing invalid index in cmpctblock message...')
    self.test_invalid_cmpctblock_message()