<p>After doing some experiments it appears that as calling the function results in an error, it is not processed, and thus the unlock time is not extended.</p>

CC BY-SA 3.0
2012-06-28T02:35:06.277Z
Right.  And that's quite annoying functionality.  If I want to make a payment, I run the unlock command, then make the payment.  If it happens that the wallet was already unlocked, but was due to lock again 1 second later, the unlock call fails, and then the wallet has locked itself before I can make the payment.  I just reported a github issue about this: https://github.com/bitcoin/bitcoin/issues/1528 because it has been annoying me for some time.
Chris Moore
CC BY-SA 3.0
2012-06-28T12:11:45.247Z
@ChrisMoore I also posted the issue earlier - https://github.com/bitcoin/bitcoin/issues/1527 .
ThePiachu
CC BY-SA 3.0
2012-06-29T18:25:54.970Z
Ugly workarounds: call walletlock before walletpassphrase.

Or call getinfo to see if the wallet is unlocked (and get the time of when it will be locked again)
gavinandresen
CC BY-SA 3.0
2012-06-28T01:10:09.567Z
2012-06-28T01:10:09.567Z
ThePiachu
<p>The Bitcoin API call for walletpassphrase allows one to open the wallet for a set amount of time. If one calls it again while the wallet is still unlocked, we get an error of 'Error: Wallet is already unlocked.'. Does the call extend the amount of time the wallet is unlocked, or not?</p>

<bitcoind><json-rpc><api>
Will calling "walletpassphrase" twice in a short amount of time increase the time the wallet stays unlocked?
ThePiachu
# Will calling "walletpassphrase" twice in a short amount of time increase the time the wallet stays unlocked?

(Asked by: username_0 on 2012-06-28)

The Bitcoin API call for walletpassphrase allows one to open the wallet for a set amount of time. If one calls it again while the wallet is still unlocked, we get an error of 'Error: Wallet is already unlocked.'. Does the call extend the amount of time the wallet is unlocked, or not?

**Tags:** bitcoind, json-rpc, api


---

## 1 answers

### Answer by username_0 on 2012-06-28. Score: 3 | Accepted answer

After doing some experiments it appears that as calling the function results in an error, it is not processed, and thus the unlock time is not extended.

> **Comments:**
> **username_1**: Right.  And that's quite annoying functionality.  If I want to make a payment, I run the unlock command, then make the payment.  If it happens that the wallet was already unlocked, but was due to lock again 1 second later, the unlock call fails, and then the wallet has locked itself before I can make the payment.  I just reported a github issue about this: https://github.com/bitcoin/bitcoin/issues/1528 because it has been annoying me for some time.  
> **username_0**: @username_1 I also posted the issue earlier - https://github.com/bitcoin/bitcoin/issues/1527 .  
> **username_2**: Ugly workarounds: call walletlock before walletpassphrase.  Or call getinfo to see if the wallet is unlocked (and get the time of when it will be locked again)  

---

