Calling "walletpassphrase" to extend the unlock time #1527

issue ThePiachu opened this issue on June 28, 2012
  1. ThePiachu commented at 1:17 AM on June 28, 2012: none

    The issue was mentioned on the StackExchange - http://bitcoin.stackexchange.com/q/4086/323 .

    Calling "walletpassphrase" allows one to unlock the wallet for a brief. However, calling it again before the time expires causes an error to be returned and the unlock time is not extended. This could cause some problems with an application that would want to execute calls to the bitcoind instance in parallel. If the application was to lock the wallet after it is done using it, another threat of the application could suddenly find the wallet locked when it shouldn't be. If the wallet is left unlocked, the other application could not extend its unlock time and bitcoind could lock it too soon.

    I propose either changing the functionality of "walletpassphrase" to extend the wallet unlock time to the longest of the two or more potential calls it receives, or introducing a new API call that could accomplish a similar goal.

  2. gavinandresen commented at 10:35 PM on August 15, 2013: contributor

    Closing; in current git HEAD (and in 0.9) the last walletpassphrase called sets the deadline.

    E.g. walletpassphrase 10 seconds ... then 5 seconds later walletpassphrase 100 seconds : wallet will be locked after 100 seconds.

    walletpassphrase 100 seconds ... then 5 seconds later walletpassphrase 5 seconds : wallet will be locked after 5 seconds.

    If you REALLY want the "extends deadline" behavior then you can call getinfo and use the unlocked_until time to compute the right value to pass to walletpassphrase.

  3. gavinandresen closed this on Aug 15, 2013

  4. lateminer referenced this in commit 6e1745be85 on May 6, 2020
  5. MarcoFalke locked this on Sep 8, 2021
  6. DrahtBot added the label CI failed on Apr 5, 2023
  7. MarcoFalke removed the label CI failed on Apr 5, 2023

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-16 03:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me