def blocksonly_mode_tests(self):
    self.log.info('Test addr relay in -blocksonly mode')
    self.restart_node(0, ['-blocksonly'])
    self.mocktime = int(time.time())
    self.log.info('Check that we send getaddr messages')
    full_outbound_peer = self.nodes[0].add_outbound_p2p_connection(GetAddrStore(), p2p_idx=0, connection_type='outbound-full-relay')
    full_outbound_peer.sync_with_ping()
    assert full_outbound_peer.getaddr_received
    self.log.info('Check that we relay address messages')
    addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
    msg = self.setup_addr_msg(2)
    self.send_addr_msg(addr_source, msg, [full_outbound_peer])
    assert_equal(full_outbound_peer.num_ipv4_received, 2)
    self.nodes[0].disconnect_p2ps()
def blocksonly_mode_tests(self):
    self.log.info('Test addr relay in -blocksonly mode')
    self.restart_node(0, ['-blocksonly'])
    self.mocktime = int(time.time())
    self.log.info('Check that we send getaddr messages')
    full_outbound_peer = self.nodes[0].add_outbound_p2p_connection(GetAddrStore(), p2p_idx=0, connection_type='outbound-full-relay')
    full_outbound_peer.sync_with_ping()
    assert full_outbound_peer.getaddr_received
    self.log.info('Check that we relay address messages')
    addr_source = self.nodes[0].add_p2p_connection(P2PInterface())
    msg = self.setup_addr_msg(2)
    self.send_addr_msg(addr_source, msg, [full_outbound_peer])
    assert_equal(full_outbound_peer.num_ipv4_received, 2)
    self.nodes[0].disconnect_p2ps()