[bisq-network/bisq] Add rpc wallet protection endpoints (#4214)
Stan
notifications at github.com
Wed May 6 20:03:04 UTC 2020
@cbeams , I am still figuring out how to ensure the wallet is encrypted in the event of a crash before `unlockpassword timeout` expiration. I think the intermediary commits fbb025a - 24248d4 above were necessary, but `CoreWalletService` still decrypts/encrypts in the unlock/lock wallet methods. This will be fixed.
I think an intermediate step in that direction is to decrypt and re-encrypt the wallet only inside the methods that need to temporarily unlock the wallet, instead of decrypting it in the `unlockwallet` method. `unlockwallet` would just cache the crypter+key, which would be used by `getbalance` to: `decrypt wallet -> getbalance -> encrypt wallet -> return balance`. The `unlockwallet timeout` task or the `lockwallet` method, whichever happens first, would clear the temp crypter+key variables (see commit 4262f29).
I don't think `getbalance` even requires wallet decryption to display an updated balance, but it would be the place to see if this is feasible until a better solution to the wallet protection unlock/lock problem is found, and new methods are implemented. (Then the wallet decrypt/encrypt code would be removed from `getbalance`.)
Tomorrow, I will run :desktop in regtest mode to see how wallet decryption/encryption works while trading and sending btc/bsq to and from other wallets. I realize maybe all that's needed to unlock the wallet is the aesKey, but _so far_, bitcoin core src tells me it decrypts the in-memory wallet in its `walletpassphrasechange` method, and Bisq / BitcoinJ src tells me `unlockwallet` will have to decrypt the wallet and save modified wallet files to disk (I could be and hope I'm wrong).
(On a related matter: the [UI does have a removepassword function](https://github.com/bisq-network/bisq/issues/4198#issuecomment-624832555).)
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4214#issuecomment-624860246
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200506/a1c050a6/attachment.html>
More information about the bisq-github
mailing list