Skip to content

Commit c89e181

Browse files
knstkwvg
andcommitted
feat: improve wording for errors, RPC and logs
Co-authored-by: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com>
1 parent b3a7475 commit c89e181

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/wallet/rpc/backup.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -874,9 +874,9 @@ RPCHelpMan dumphdinfo()
874874
RPCResult{
875875
RPCResult::Type::OBJ, "", "",
876876
{
877-
{RPCResult::Type::STR_HEX, "hdseed", "The HD seed (bip32, in hex)"},
878-
{RPCResult::Type::STR, "mnemonic", "The mnemonic for this HD wallet (bip39, english words)"},
879-
{RPCResult::Type::STR, "mnemonicpassphrase", "The mnemonic passphrase for this HD wallet (bip39)"},
877+
{RPCResult::Type::STR_HEX, "hdseed", "The HD seed (BIP32, in hex)"},
878+
{RPCResult::Type::STR, "mnemonic", "The mnemonic for this HD wallet (BIP39, english words)"},
879+
{RPCResult::Type::STR, "mnemonicpassphrase", "The mnemonic passphrase for this HD wallet (BIP39)"},
880880
}
881881
},
882882
RPCExamples{
@@ -1969,8 +1969,8 @@ RPCHelpMan listdescriptors()
19691969
{
19701970
{RPCResult::Type::OBJ, "", "", {
19711971
{RPCResult::Type::STR, "desc", "Descriptor string representation"},
1972-
{RPCResult::Type::STR, "mnemonic", "The mnemonic for this Descriptor wallet (bip39, english words). Presented only if private=true and created with mnemonic"},
1973-
{RPCResult::Type::STR, "mnemonicpassphrase", "The mnemonic passphrase for this Descriptor wallet (bip39). Presented only if private=true and created with mnemonic"},
1972+
{RPCResult::Type::STR, "mnemonic", "The mnemonic for this descriptor wallet (BIP39, english words). Presented only if private=true and created with a mnemonic"},
1973+
{RPCResult::Type::STR, "mnemonicpassphrase", "The mnemonic passphrase for this descriptor wallet (BIP39). Presented only if private=true and created with a mnemonic"},
19741974
{RPCResult::Type::NUM, "timestamp", "The creation time of the descriptor"},
19751975
{RPCResult::Type::BOOL, "active", "Whether this descriptor is currently used to generate new addresses"},
19761976
{RPCResult::Type::BOOL, "internal", /*optional=*/true, "True if this descriptor is used to generate change addresses. False if this descriptor is used to generate receiving addresses; defined only for active descriptors"},

src/wallet/rpc/encrypt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ RPCHelpMan encryptwallet()
253253
}
254254

255255
if (pwallet->IsHDEnabled()) {
256-
return "wallet encrypted; If you will forget passphrase you will lose access to your funds. Be sure that you have backup of your seed or mnemonic.";
256+
return "wallet encrypted; If you forget the passphrase, you will lose access to your funds. Make sure that you have backup of your seed or mnemonic.";
257257
}
258258
return "wallet encrypted; The keypool has been flushed. You need to make a new backup.";
259259
},

src/wallet/scriptpubkeyman.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,14 +2513,14 @@ bool DescriptorScriptPubKeyMan::GetMnemonicString(SecureString& mnemonic_out, Se
25132513
if (!m_storage.WithEncryptionKey([&](const CKeyingMaterial& encryption_key) {
25142514
return DecryptSecret(encryption_key, crypted_mnemonic, pubkey.GetHash(), mnemonic_v);
25152515
})) {
2516-
LogPrintf("can't decrypt mnemonic pubkey %s crypted: %s\n", pubkey.GetHash().ToString(), HexStr(crypted_mnemonic));
2516+
WalletLogPrintf("%s: ERROR: can't decrypt mnemonic pubkey %s crypted: %s\n", __func__, pubkey.GetHash().ToString(), HexStr(crypted_mnemonic));
25172517
return false;
25182518
}
25192519
if (!crypted_mnemonic_passphrase.empty()) {
25202520
if (!m_storage.WithEncryptionKey([&](const CKeyingMaterial& encryption_key) {
25212521
return DecryptSecret(encryption_key, crypted_mnemonic_passphrase, pubkey.GetHash(), mnemonic_passphrase_v);
25222522
})) {
2523-
LogPrintf("can't decrypt mnemonic-passphrase\n");
2523+
WalletLogPrintf("%s: ERROR: can't decrypt mnemonic passphrase\n", __func__);
25242524
return false;
25252525
}
25262526
}

0 commit comments

Comments
 (0)