code: func (w *Wallet) Close() error {
  	// Ensure the wallet was opened
  	w.lock.Lock()
  	dQuit := w.deriveQuit
  	w.lock.Unlock()
  
  	// Terminate the self-derivations
  	var derr error
  	if dQuit != nil {
  		errc := make(chan error)
  		dQuit <- errc
  		derr = <-errc // Save for later, we *must* close the USB
  	}
  	// Terminate the device connection
  	w.lock.Lock()
  	defer w.lock.Unlock()
  
  	w.deriveQuit = nil
  	w.deriveReq = nil
  
  	if err := w.release(); err != nil {
  		return err
  	}
  	return derr
  }
docs: // Close stops and closes the wallet, freeing any resources.