Skip to content

Commit 40e1c4d

Browse files
committed
Merge bitcoin/bitcoin#25666: refactor: wallet, do not translate init options names
e43a547 refactor: wallet, do not translate init arguments names (furszy) Pull request description: Simple, and not interesting, refactor that someone has to do sooner or later. We are translating some init arguments names when those shouldn't be translated. ACKs for top commit: achow101: ACK e43a547 MarcoFalke: lgtm ACK e43a547 ryanofsky: Code review ACK e43a547. Just rebased since last review. Tree-SHA512: c6eca98fd66d54d5510de03ab4e63c00ba2838af4237d2bb135d01c47f8ad8ca9aa7ae1e45cf668afcfb9dd958b075a1756cc887b3beef2cb494933d4d83eab0
2 parents 0973018 + e43a547 commit 40e1c4d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/wallet/spend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
876876
}
877877
if (feeCalc.reason == FeeReason::FALLBACK && !wallet.m_allow_fallback_fee) {
878878
// eventually allow a fallback fee
879-
return util::Error{_("Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.")};
879+
return util::Error{strprintf(_("Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable %s."), "-fallbackfee")};
880880
}
881881

882882
// Calculate the cost of change

src/wallet/wallet.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
30633063
if (args.IsArgSet("-fallbackfee")) {
30643064
std::optional<CAmount> fallback_fee = ParseMoney(args.GetArg("-fallbackfee", ""));
30653065
if (!fallback_fee) {
3066-
error = strprintf(_("Invalid amount for -fallbackfee=<amount>: '%s'"), args.GetArg("-fallbackfee", ""));
3066+
error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-fallbackfee", args.GetArg("-fallbackfee", ""));
30673067
return nullptr;
30683068
} else if (fallback_fee.value() > HIGH_TX_FEE_PER_KB) {
30693069
warnings.push_back(AmountHighWarn("-fallbackfee") + Untranslated(" ") +
@@ -3078,7 +3078,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
30783078
if (args.IsArgSet("-discardfee")) {
30793079
std::optional<CAmount> discard_fee = ParseMoney(args.GetArg("-discardfee", ""));
30803080
if (!discard_fee) {
3081-
error = strprintf(_("Invalid amount for -discardfee=<amount>: '%s'"), args.GetArg("-discardfee", ""));
3081+
error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-discardfee", args.GetArg("-discardfee", ""));
30823082
return nullptr;
30833083
} else if (discard_fee.value() > HIGH_TX_FEE_PER_KB) {
30843084
warnings.push_back(AmountHighWarn("-discardfee") + Untranslated(" ") +
@@ -3100,8 +3100,8 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
31003100
walletInstance->m_pay_tx_fee = CFeeRate{pay_tx_fee.value(), 1000};
31013101

31023102
if (chain && walletInstance->m_pay_tx_fee < chain->relayMinFee()) {
3103-
error = strprintf(_("Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"),
3104-
args.GetArg("-paytxfee", ""), chain->relayMinFee().ToString());
3103+
error = strprintf(_("Invalid amount for %s=<amount>: '%s' (must be at least %s)"),
3104+
"-paytxfee", args.GetArg("-paytxfee", ""), chain->relayMinFee().ToString());
31053105
return nullptr;
31063106
}
31073107
}
@@ -3112,12 +3112,12 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
31123112
error = AmountErrMsg("maxtxfee", args.GetArg("-maxtxfee", ""));
31133113
return nullptr;
31143114
} else if (max_fee.value() > HIGH_MAX_TX_FEE) {
3115-
warnings.push_back(_("-maxtxfee is set very high! Fees this large could be paid on a single transaction."));
3115+
warnings.push_back(strprintf(_("%s is set very high! Fees this large could be paid on a single transaction."), "-maxtxfee"));
31163116
}
31173117

31183118
if (chain && CFeeRate{max_fee.value(), 1000} < chain->relayMinFee()) {
3119-
error = strprintf(_("Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"),
3120-
args.GetArg("-maxtxfee", ""), chain->relayMinFee().ToString());
3119+
error = strprintf(_("Invalid amount for %s=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"),
3120+
"-maxtxfee", args.GetArg("-maxtxfee", ""), chain->relayMinFee().ToString());
31213121
return nullptr;
31223122
}
31233123

0 commit comments

Comments
 (0)