fix DS bug - endless collateral creation until one of them confirms

This commit is contained in:
UdjinM6 2015-08-16 03:29:16 +03:00
parent 628d281209
commit a723c2148e
3 changed files with 4 additions and 4 deletions

View File

@ -1462,7 +1462,7 @@ bool CDarksendPool::DoAutomaticDenominating(bool fDryRun)
if(nBalanceNeedsDenominated > nOnlyDenominatedBalance) return CreateDenominated(nBalanceNeedsDenominated);
//check if we have the collateral sized inputs
if(!pwalletMain->HasCollateralInputs()) return MakeCollateralAmounts();
if(!pwalletMain->HasCollateralInputs()) return !pwalletMain->HasCollateralInputs(false) && MakeCollateralAmounts();
std::vector<CTxOut> vOut;

View File

@ -1963,10 +1963,10 @@ int CWallet::CountInputsWithAmount(int64_t nInputAmount)
return nTotal;
}
bool CWallet::HasCollateralInputs() const
bool CWallet::HasCollateralInputs(bool fOnlyConfirmed) const
{
vector<COutput> vCoins;
AvailableCoins(vCoins);
AvailableCoins(vCoins, fOnlyConfirmed);
int nFound = 0;
BOOST_FOREACH(const COutput& out, vCoins)

View File

@ -151,7 +151,7 @@ public:
bool SelectCoinsDark(int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax) const;
bool SelectCoinsByDenominations(int nDenom, int64_t nValueMin, int64_t nValueMax, std::vector<CTxIn>& vCoinsRet, std::vector<COutput>& vCoinsRet2, int64_t& nValueRet, int nDarksendRoundsMin, int nDarksendRoundsMax);
bool SelectCoinsDarkDenominated(int64_t nTargetValue, std::vector<CTxIn>& setCoinsRet, int64_t& nValueRet) const;
bool HasCollateralInputs() const;
bool HasCollateralInputs(bool fOnlyConfirmed = true) const;
bool IsCollateralAmount(int64_t nInputAmount) const;
int CountInputsWithAmount(int64_t nInputAmount);