code: func (net *Network) ConnectToLastNode(id enode.ID) (err error) {
  	net.lock.Lock()
  	defer net.lock.Unlock()
  
  	ids := net.getUpNodeIDs()
  	l := len(ids)
  	if l < 2 {
  		return nil
  	}
  	last := ids[l-1]
  	if last == id {
  		last = ids[l-2]
  	}
  	return net.connectNotConnected(last, id)
  }
docs: // ConnectToLastNode connects the node with provided NodeID
  // to the last node that is up, and avoiding connection to self.
  // It is useful when constructing a chain network topology
  // when Network adds and removes nodes dynamically.