diff --git a/src/wallet/rpc/encrypt.cpp b/src/wallet/rpc/encrypt.cpp index 0226d15698bab8..a79f403dd9d4dd 100644 --- a/src/wallet/rpc/encrypt.cpp +++ b/src/wallet/rpc/encrypt.cpp @@ -18,7 +18,7 @@ RPCHelpMan walletpassphrase() "time that overrides the old one.\n", { {"passphrase", RPCArg::Type::STR, RPCArg::Optional::NO, "The wallet passphrase"}, - {"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The time to keep the decryption key in seconds; capped at 100000000 (~3 years)."}, + {"timeout", RPCArg::Type::NUM, RPCArg::Optional::NO, "The time to keep the decryption key in seconds; capped at 100000000 (~3 years), will use cap if 0 specified"}, }, RPCResult{RPCResult::Type::NONE, "", ""}, RPCExamples{ @@ -59,7 +59,7 @@ RPCHelpMan walletpassphrase() } // Clamp timeout constexpr int64_t MAX_SLEEP_TIME = 100000000; // larger values trigger a macos/libevent bug? - if (nSleepTime > MAX_SLEEP_TIME) { + if (nSleepTime > MAX_SLEEP_TIME || nSleepTime == 0) { nSleepTime = MAX_SLEEP_TIME; }