Make walletpassphrase with timeout=0 never lock the wallet.

This broke when the Unlock API changed to replace the timeout in
seconds with a time.Time channel.
This commit is contained in:
Josh Rickmar 2016-02-15 11:35:28 -05:00
parent 4171638553
commit d2e93f9427

View file

@ -1956,7 +1956,11 @@ func WalletPassphrase(icmd interface{}, w *wallet.Wallet) (interface{}, error) {
cmd := icmd.(*btcjson.WalletPassphraseCmd)
timeout := time.Second * time.Duration(cmd.Timeout)
err := w.Unlock([]byte(cmd.Passphrase), time.After(timeout))
var unlockAfter <-chan time.Time
if timeout != 0 {
unlockAfter = time.After(timeout)
}
err := w.Unlock([]byte(cmd.Passphrase), unlockAfter)
return nil, err
}