HasEncryptionKeys().
scripted-diff: refactor: wallet: Delete duplicate IsCrypted() #34147
pull davidgumberg wants to merge 1 commits into bitcoin:master from davidgumberg:2025-12-24-delete-iscrypted changing 7 files +15 −21-
davidgumberg commented at 7:11 pm on December 24, 2025: contributorThis function is a duplicate of
-
11ce5cf799
scripted-diff: refactor: wallet: Delete IsCrypted
This function is a duplicate of HasEncryptionKeys(). -BEGIN VERIFY SCRIPT- sed -i '/bool IsCrypted() const;/d' src/wallet/wallet.h sed -i '/^bool CWallet::IsCrypted() const$/,/^}$/{/^}$/N;d;}' src/wallet/wallet.cpp sed -i --regexp-extended 's/IsCrypted\(\)/HasEncryptionKeys()/g' $(git ls-files '*.cpp' '*.h') -END VERIFY SCRIPT- -
DrahtBot added the label Refactoring on Dec 24, 2025
-
DrahtBot commented at 7:12 pm on December 24, 2025: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34147.
Reviews
See the guideline for information on the review process.
Type Reviewers ACK maflcko, billymcbip, polespinasa, rkrux If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #28333 (wallet: Construct ScriptPubKeyMans with all data rather than loaded progressively by achow101)
- #27865 (wallet: Track no-longer-spendable TXOs separately by achow101)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
maflcko commented at 8:56 am on December 25, 2025: member
lgtm.
i think the command size can be reduced by replacing the
ls-fileswithgit grep -l IsCrypted, but the command passes, so this is not required.review ACK 11ce5cf7997e6d09806dd4e73043afa758810856 🔀
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}" 1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM= 2trusted comment: review ACK 11ce5cf7997e6d09806dd4e73043afa758810856 🔀 3a9Qham9/Ya82U/jQU1i/5WpuEpEQSmWQb+cOUGsNLFoBF+V66Of6KlnSF21XvkEB+JYYnhUOIHl3jj5TxsYADA== -
billymcbip commented at 9:37 am on December 25, 2025: contributorutACK 11ce5cf
-
polespinasa approved
-
polespinasa commented at 9:41 am on December 25, 2025: member
code review tACK 11ce5cf7997e6d09806dd4e73043afa758810856
The existence of
IsCrypted()made sense in the past as it had a unique behaviour but since https://github.com/bitcoin/bitcoin/pull/17369/changes/bf6417142f36a2f75b3a11368bd73fe788ae1ccb it just wrappesHasEncryptionKeys()The script provided works. Bc there are not many changes did a simple manual double check and it matches :)
0....@...:~/BitcoinCore/bitcoin$ git grep -n IsCrypted 1src/qt/walletmodel.h:71: Unencrypted, // !wallet->IsCrypted() 2src/qt/walletmodel.h:72: Locked, // wallet->IsCrypted() && wallet->IsLocked() 3src/qt/walletmodel.h:73: Unlocked // wallet->IsCrypted() && !wallet->IsLocked() 4src/wallet/interfaces.cpp:143: bool isCrypted() override { return m_wallet->IsCrypted(); } 5src/wallet/interfaces.cpp:626: if (it != wallets.end()) return (*it)->IsCrypted(); 6src/wallet/rpc/encrypt.cpp:48: if (!pwallet->IsCrypted()) { 7src/wallet/rpc/encrypt.cpp:137: if (!pwallet->IsCrypted()) { 8src/wallet/rpc/encrypt.cpp:202: if (!pwallet->IsCrypted()) { 9src/wallet/rpc/encrypt.cpp:259: if (pwallet->IsCrypted()) { 10src/wallet/rpc/wallet.cpp:96: if (pwallet->IsCrypted()) { 11src/wallet/wallet.cpp:768: if (IsCrypted()) 12src/wallet/wallet.cpp:3294:bool CWallet::IsCrypted() const 13src/wallet/wallet.cpp:3301: if (!IsCrypted()) { 14src/wallet/wallet.cpp:3310: if (!IsCrypted()) 15src/wallet/wallet.cpp:3524: if (IsCrypted()) { 16src/wallet/wallet.h:492: bool IsCrypted() const; 17src/wallet/wallettool.cpp:101: tfm::format(std::cout, "Encrypted: %s\n", wallet_instance->IsCrypted() ? "yes" : "no"); -
in src/wallet/interfaces.cpp:143 in 11ce5cf799
139@@ -140,7 +140,7 @@ class WalletImpl : public Wallet 140 { 141 return m_wallet->EncryptWallet(wallet_passphrase); 142 } 143- bool isCrypted() override { return m_wallet->IsCrypted(); } 144+ bool isCrypted() override { return m_wallet->HasEncryptionKeys(); }
rkrux commented at 8:19 am on December 26, 2025:Many method names in
WalletImplhave the same words as in the method names ofCWallet, so along the same lines:0- bool isCrypted() override { return m_wallet->HasEncryptionKeys(); } 1+ bool hasEncryptionKeys() override { return m_wallet->HasEncryptionKeys(); }rkrux commented at 8:21 am on December 26, 2025: contributorcrACK 11ce5cf7997e6d09806dd4e73043afa758810856
Suggested a rename of a function used in GUI but looks fine as-is as well.
fanquake merged this on Dec 27, 2025fanquake closed this on Dec 27, 2025
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-01-02 00:13 UTC
More mirrored repositories can be found on mirror.b10c.me