code: func unlockAccount(ks *keystore.KeyStore, address string, i int, passwords []string) (accounts.Account, string) {
  	account, err := utils.MakeAddress(ks, address)
  	if err != nil {
  		utils.Fatalf("Could not list accounts: %v", err)
  	}
  	for trials := 0; trials < 3; trials++ {
  		prompt := fmt.Sprintf("Unlocking account %s | Attempt %d/%d", address, trials+1, 3)
  		password := getPassPhrase(prompt, false, i, passwords)
  		err = ks.Unlock(account, password)
  		if err == nil {
  			log.Info("Unlocked account", "address", account.Address.Hex())
  			return account, password
  		}
  		if err, ok := err.(*keystore.AmbiguousAddrError); ok {
  			log.Info("Unlocked account", "address", account.Address.Hex())
  			return ambiguousAddrRecovery(ks, err, password), password
  		}
  		if err != keystore.ErrDecrypt {
  			// No need to prompt again if the error is not decryption-related.
  			break
  		}
  	}
  	// All trials expended to unlock account, bail out
  	utils.Fatalf("Failed to unlock account %s (%v)", address, err)
  
  	return accounts.Account{}, ""
  }
docs: // tries unlocking the specified account a few times.