diff options
author | John Newbery <john@johnnewbery.com> | 2019-10-14 13:32:41 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2019-10-14 13:32:41 -0400 |
commit | eea462de9c652dca556ad241d2126b10790f67f8 (patch) | |
tree | a2744495dcb9580b02479c89e33e0b77ef194a45 /src/wallet | |
parent | b33c03b0cb82e57eb862542c9d331b7ceb8f3a62 (diff) |
[wallet] Remove package limit config access from wallet
The wallet should not be able to directly access global configuration
from the node. Remove access of "-limitancestorcount" and
"-limitdescendantcount".
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/wallet.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 09f08220db..1551c645d0 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -27,7 +27,6 @@ #include <util/rbf.h> #include <util/translation.h> #include <util/validation.h> -#include <validation.h> #include <wallet/coincontrol.h> #include <wallet/fees.h> @@ -2739,8 +2738,11 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm } std::vector<OutputGroup> groups = GroupOutputs(vCoins, !coin_control.m_avoid_partial_spends); - size_t max_ancestors = (size_t)std::max<int64_t>(1, gArgs.GetArg("-limitancestorcount", DEFAULT_ANCESTOR_LIMIT)); - size_t max_descendants = (size_t)std::max<int64_t>(1, gArgs.GetArg("-limitdescendantcount", DEFAULT_DESCENDANT_LIMIT)); + unsigned int limit_ancestor_count; + unsigned int limit_descendant_count; + chain().getPackageLimits(limit_ancestor_count, limit_descendant_count); + size_t max_ancestors = (size_t)std::max<int64_t>(1, limit_ancestor_count); + size_t max_descendants = (size_t)std::max<int64_t>(1, limit_descendant_count); bool fRejectLongChains = gArgs.GetBoolArg("-walletrejectlongchains", DEFAULT_WALLET_REJECT_LONG_CHAINS); bool res = nTargetValue <= nValueFromPresetInputs || |