Repository navigation
Unlock node wallet if locked (#31) - #65
Open
ocakciomursel-pixel wants to merge 1 commit into
Open
ocakciomursel-pixel wants to merge 1 commit into
ocakciomursel-pixel wants to merge 1 commit into
Conversation
…s#31) - Add optional `wallet_password` setting under `[node]` configuration - Add `ensure_wallet_unlocked` check in `ServerState` and `TransactionService` to unlock the node wallet via `node.endpoints().wallet()?.unlock(...)` when locked - Ensure wallet is unlocked before querying wallet addresses, private keys, UTXOs, change address, signing, and triggering wallet rescan - Add unit tests verifying wallet unlock flow and locked-without-password error handling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #31
Summary
wallet_passwordconfiguration field tochaincash_offchain::node::Config([node]section inconfig/default.toml).ensure_wallet_unlockedhelper inchaincash_server::ServerStateandchaincash_services::TransactionServiceto inspectwallet.status().await?.is_unlockedbefore readingchange_address.wallet_passwordviawallet.unlock(&password).await(or return a descriptiveLockedWalleterror if no password is configured) and re-fetchwallet.status()sochange_addressis populated.crates/chaincash_services/src/transaction.rscovering already-unlocked wallets, locked wallets with a configured password, and locked wallets without a configured password.