New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wallet re-lock can happen in the middle of RPC call #3673
Comments
… be unlocked This is my idea on how to resolve bitcoin#3673. @laanwj suggested obtaining the `cs_wallet` lock inside of LockWallet(), but that will cause a deadlock if walletlock() were ever refactored to call LockWallet, which I think is a good idea. Test Plan: These changes pass `make`, but `make check` outputs several problems: ``` $ make check Making check in src Making check in . Making check in qt /Applications/Xcode.app/Contents/Developer/usr/bin/make check-recursive Making check in test /Applications/Xcode.app/Contents/Developer/usr/bin/make check-am /Applications/Xcode.app/Contents/Developer/usr/bin/make check-TESTS ../../../src/build-aux/test-driver: line 107: 1152 Abort trap: 6 "$@" > $log_file 2>&1 FAIL: test_bitcoin-qt /Applications/Xcode.app/Contents/Developer/usr/bin/make all-am make[9]: Nothing to be done for `all-am'. ============================================================================ Testsuite summary for Bitcoin Core 0.9.99 ============================================================================ ============================================================================ See src/qt/test/test-suite.log Please report to info@bitcoin.org ============================================================================ make[7]: *** [test-suite.log] Error 1 make[6]: *** [check-TESTS] Error 2 make[5]: *** [check-am] Error 2 make[4]: *** [check] Error 2 make[3]: *** [check-recursive] Error 1 make[2]: *** [check] Error 2 make[1]: *** [check-recursive] Error 1 make: *** [check-recursive] Error 1 ```
I took a quick look at this and figured that'd it be easier to add I also refactored The changes are here, but I have not been able to get |
I'm not convinced that this is a problem. Besides causing RPC to spit out different error messages, it doesn't seem to ever cause real problems such as crashes. Trying to solve it is probably more risky than leaving it as-is. |
…tcoin#3673) Signed-off-by: pasta <pasta@dashboost.org>
Not sure if this is expected: when the wallet unlock times out, this can be in the middle of an operation, resulting in different errors,
As the cs_wallet lock is always held before calling wallet RPCs, a possible solution would be to aquire cs_wallet in LockWallet (https://github.com/bitcoin/bitcoin/blob/master/src/rpcwallet.cpp#L1545).
The text was updated successfully, but these errors were encountered: