0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Merge bitcoin/bitcoin#25666: refactor: wallet, do not translate init options names

e43a547a36 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 e43a547a36
  MarcoFalke:
    lgtm ACK e43a547a36
  ryanofsky:
    Code review ACK e43a547a36. Just rebased since last review.

Tree-SHA512: c6eca98fd66d54d5510de03ab4e63c00ba2838af4237d2bb135d01c47f8ad8ca9aa7ae1e45cf668afcfb9dd958b075a1756cc887b3beef2cb494933d4d83eab0
This commit is contained in:
fanquake 2023-03-19 12:12:17 +00:00
commit 40e1c4d402
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1
2 changed files with 8 additions and 8 deletions

View file

@ -876,7 +876,7 @@ static util::Result<CreatedTransactionResult> CreateTransactionInternal(
} }
if (feeCalc.reason == FeeReason::FALLBACK && !wallet.m_allow_fallback_fee) { if (feeCalc.reason == FeeReason::FALLBACK && !wallet.m_allow_fallback_fee) {
// eventually allow a fallback fee // eventually allow a fallback fee
return util::Error{_("Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.")}; return util::Error{strprintf(_("Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable %s."), "-fallbackfee")};
} }
// Calculate the cost of change // Calculate the cost of change

View file

@ -3063,7 +3063,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
if (args.IsArgSet("-fallbackfee")) { if (args.IsArgSet("-fallbackfee")) {
std::optional<CAmount> fallback_fee = ParseMoney(args.GetArg("-fallbackfee", "")); std::optional<CAmount> fallback_fee = ParseMoney(args.GetArg("-fallbackfee", ""));
if (!fallback_fee) { if (!fallback_fee) {
error = strprintf(_("Invalid amount for -fallbackfee=<amount>: '%s'"), args.GetArg("-fallbackfee", "")); error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-fallbackfee", args.GetArg("-fallbackfee", ""));
return nullptr; return nullptr;
} else if (fallback_fee.value() > HIGH_TX_FEE_PER_KB) { } else if (fallback_fee.value() > HIGH_TX_FEE_PER_KB) {
warnings.push_back(AmountHighWarn("-fallbackfee") + Untranslated(" ") + warnings.push_back(AmountHighWarn("-fallbackfee") + Untranslated(" ") +
@ -3078,7 +3078,7 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
if (args.IsArgSet("-discardfee")) { if (args.IsArgSet("-discardfee")) {
std::optional<CAmount> discard_fee = ParseMoney(args.GetArg("-discardfee", "")); std::optional<CAmount> discard_fee = ParseMoney(args.GetArg("-discardfee", ""));
if (!discard_fee) { if (!discard_fee) {
error = strprintf(_("Invalid amount for -discardfee=<amount>: '%s'"), args.GetArg("-discardfee", "")); error = strprintf(_("Invalid amount for %s=<amount>: '%s'"), "-discardfee", args.GetArg("-discardfee", ""));
return nullptr; return nullptr;
} else if (discard_fee.value() > HIGH_TX_FEE_PER_KB) { } else if (discard_fee.value() > HIGH_TX_FEE_PER_KB) {
warnings.push_back(AmountHighWarn("-discardfee") + Untranslated(" ") + warnings.push_back(AmountHighWarn("-discardfee") + Untranslated(" ") +
@ -3100,8 +3100,8 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
walletInstance->m_pay_tx_fee = CFeeRate{pay_tx_fee.value(), 1000}; walletInstance->m_pay_tx_fee = CFeeRate{pay_tx_fee.value(), 1000};
if (chain && walletInstance->m_pay_tx_fee < chain->relayMinFee()) { if (chain && walletInstance->m_pay_tx_fee < chain->relayMinFee()) {
error = strprintf(_("Invalid amount for -paytxfee=<amount>: '%s' (must be at least %s)"), error = strprintf(_("Invalid amount for %s=<amount>: '%s' (must be at least %s)"),
args.GetArg("-paytxfee", ""), chain->relayMinFee().ToString()); "-paytxfee", args.GetArg("-paytxfee", ""), chain->relayMinFee().ToString());
return nullptr; return nullptr;
} }
} }
@ -3112,12 +3112,12 @@ std::shared_ptr<CWallet> CWallet::Create(WalletContext& context, const std::stri
error = AmountErrMsg("maxtxfee", args.GetArg("-maxtxfee", "")); error = AmountErrMsg("maxtxfee", args.GetArg("-maxtxfee", ""));
return nullptr; return nullptr;
} else if (max_fee.value() > HIGH_MAX_TX_FEE) { } else if (max_fee.value() > HIGH_MAX_TX_FEE) {
warnings.push_back(_("-maxtxfee is set very high! Fees this large could be paid on a single transaction.")); warnings.push_back(strprintf(_("%s is set very high! Fees this large could be paid on a single transaction."), "-maxtxfee"));
} }
if (chain && CFeeRate{max_fee.value(), 1000} < chain->relayMinFee()) { if (chain && CFeeRate{max_fee.value(), 1000} < chain->relayMinFee()) {
error = strprintf(_("Invalid amount for -maxtxfee=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"), error = strprintf(_("Invalid amount for %s=<amount>: '%s' (must be at least the minrelay fee of %s to prevent stuck transactions)"),
args.GetArg("-maxtxfee", ""), chain->relayMinFee().ToString()); "-maxtxfee", args.GetArg("-maxtxfee", ""), chain->relayMinFee().ToString());
return nullptr; return nullptr;
} }