fix: follow-up changes from bitcoin/bitcoin#22220 for maxapsfee

This commit is contained in:
Konstantin Akimov 2024-02-24 16:25:32 +07:00
parent eb4270deae
commit 1707f01309
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -4694,18 +4694,18 @@ std::shared_ptr<CWallet> CWallet::Create(interfaces::Chain& chain, interfaces::C
if (gArgs.IsArgSet("-maxapsfee")) {
const std::string max_aps_fee{gArgs.GetArg("-maxapsfee", "")};
CAmount n = 0;
if (max_aps_fee == "-1") {
n = -1;
} else if (!ParseMoney(max_aps_fee, n)) {
walletInstance->m_max_aps_fee = -1;
} else if (std::optional<CAmount> max_fee = ParseMoney(max_aps_fee)) {
if (max_fee.value() > HIGH_APS_FEE) {
warnings.push_back(AmountHighWarn("-maxapsfee") + Untranslated(" ") +
_("This is the maximum transaction fee you pay (in addition to the normal fee) to prioritize partial spend avoidance over regular coin selection."));
}
walletInstance->m_max_aps_fee = max_fee.value();
} else {
error = AmountErrMsg("maxapsfee", max_aps_fee);
return nullptr;
}
if (n > HIGH_APS_FEE) {
warnings.push_back(AmountHighWarn("-maxapsfee") + Untranslated(" ") +
_("This is the maximum transaction fee you pay (in addition to the normal fee) to prioritize partial spend avoidance over regular coin selection."));
}
walletInstance->m_max_aps_fee = n;
}
if (gArgs.IsArgSet("-fallbackfee")) {