code: func (w *wallet) close() error {
  	// Allow duplicate closes, especially for health-check failures
  	if w.device == nil {
  		return nil
  	}
  	// Close the device, clear everything, then return
  	w.device.Close()
  	w.device = nil
  
  	w.accounts, w.paths = nil, nil
  	return w.driver.Close()
  }
docs: // close is the internal wallet closer that terminates the USB connection and
  // resets all the fields to their defaults.
  //
  // Note, close assumes the state lock is held!