Skip to content

Commit

Permalink
Make walletpassphrase with timeout=0 never lock the wallet.
Browse files Browse the repository at this point in the history
This broke when the Unlock API changed to replace the timeout in
seconds with a time.Time channel.
  • Loading branch information
jrick committed Feb 15, 2016
1 parent 4171638 commit d2e93f9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rpc/legacyrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d2e93f9

Please sign in to comment.