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:
$ 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:
$ 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.