bitcoin/bitcoin — pull request #3714 by chjj (2014-02-21 03:55:21+00:00)
Title: Keep walletpassphrase until the next api call it's used in

This patch will allow `-1` to be passed to walletpassphrase as the timeout. A timeout of `-1` will hold the passphrase in memory until the next api call is made that requires it.

Example:

``` bash
$ bitcoind walletpassphrase hunter2 -1
$ bitcoind getaccountaddress ''
1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd
$ bitcoind signmessage 1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd foo
H5UQlcIJjSWbNK/MFaP0LDGt8CSkbe9D8FbdGUFHM/hAQ0avEchg2sJ8v2db8ynOD2PqQwYuR/5tbbKl7LiMUEE=
$ bitcoind signmessage 1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd foo
error: {"code":-13,"message":"Error: Please enter the wallet passphrase with walletpassphrase first."}
```

I realize something similar is doable with:

``` bash
$ bitcoind walletpassphrase hunter2 60
$ bitcoind signmessage 1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd foo
H5UQlcIJjSWbNK/MFaP0LDGt8CSkbe9D8FbdGUFHM/hAQ0avEchg2sJ8v2db8ynOD2PqQwYuR/5tbbKl7LiMUEE=
$ bitcoind walletlock
```

The former just seems like it might be more convenient for some situations.