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:
parent
4171638553
commit
d2e93f9427
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue