2192+ SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 1, 6, 0, vCoins, setCoinsRet, nValueRet) ||
2193+ SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 1, 1, 0, vCoins, setCoinsRet, nValueRet) ||
2194+ (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, std::min((size_t)2, nLimitAncestors/4), vCoins, setCoinsRet, nValueRet)) ||
2195+ (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, std::min((size_t)4, nLimitAncestors/3), vCoins, setCoinsRet, nValueRet)) ||
2196+ (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, nLimitAncestors/2, vCoins, setCoinsRet, nValueRet)) ||
2197+ (bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue - nValueFromPresetInputs, 0, 1, frejectLongChains ? nLimitAncestors : std::numeric_limits<uint64_t>::max(), vCoins, setCoinsRet, nValueRet));
Shouldn’t nLimitAncestors
here be (nLimitAncestors - 1)
, because otherwise the new transaction would be 1 beyond the limit?
Even if frejectLongChains
is set, shouldn’t we prefer coins <nLimitAncestors when possible?
the count counts the coin itself in the chain length, so I think it’s right as-is. >=
is the check to reject.