test
This commit is contained in:
@@ -2384,7 +2384,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet, bool& fOnlyCoinbaseCoinsRet, bool& fNeedCoinbaseCoinsRet, const CCoinControl* coinControl) const
|
bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet, bool& fOnlyCoinbaseCoinsRet, bool& fNeedCoinbaseCoinsRet, const CCoinControl* coinControl,uint64_t *interestp) const
|
||||||
{
|
{
|
||||||
// Output parameter fOnlyCoinbaseCoinsRet is set to true when the only available coins are coinbase utxos.
|
// Output parameter fOnlyCoinbaseCoinsRet is set to true when the only available coins are coinbase utxos.
|
||||||
vector<COutput> vCoinsNoCoinbase, vCoinsWithCoinbase;
|
vector<COutput> vCoinsNoCoinbase, vCoinsWithCoinbase;
|
||||||
@@ -2545,7 +2545,8 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
|
|||||||
CAmount nValueIn = 0;
|
CAmount nValueIn = 0;
|
||||||
bool fOnlyCoinbaseCoins = false;
|
bool fOnlyCoinbaseCoins = false;
|
||||||
bool fNeedCoinbaseCoins = false;
|
bool fNeedCoinbaseCoins = false;
|
||||||
if (!SelectCoins(nTotalValue, setCoins, nValueIn, fOnlyCoinbaseCoins, fNeedCoinbaseCoins, coinControl))
|
interest = 0;
|
||||||
|
if (!SelectCoins(nTotalValue, setCoins, nValueIn, fOnlyCoinbaseCoins, fNeedCoinbaseCoins, coinControl,&interest))
|
||||||
{
|
{
|
||||||
if (fOnlyCoinbaseCoins && Params().GetConsensus().fCoinbaseMustBeProtected) {
|
if (fOnlyCoinbaseCoins && Params().GetConsensus().fCoinbaseMustBeProtected) {
|
||||||
strFailReason = _("Coinbase funds can only be sent to a zaddr");
|
strFailReason = _("Coinbase funds can only be sent to a zaddr");
|
||||||
@@ -2556,12 +2557,10 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend,
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
interest = 0;
|
fprintf(stderr,"interest sum %.8f\n",(double)interest/COIN);
|
||||||
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
|
BOOST_FOREACH(PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins)
|
||||||
{
|
{
|
||||||
CAmount nCredit = pcoin.first->vout[pcoin.second].nValue;
|
CAmount nCredit = pcoin.first->vout[pcoin.second].nValue;
|
||||||
fprintf(stderr,"val %.8f interest %.8f\n",(double)nCredit/COIN,(double)pcoin.vout[pcoin.second].interest);
|
|
||||||
interest += pcoin.vout[pcoin.second].interest;
|
|
||||||
//The coin age after the next block (depth+1) is used instead of the current,
|
//The coin age after the next block (depth+1) is used instead of the current,
|
||||||
//reflecting an assumption the user would accept a bit more delay for
|
//reflecting an assumption the user would accept a bit more delay for
|
||||||
//a chance at a free transaction.
|
//a chance at a free transaction.
|
||||||
|
|||||||
Reference in New Issue
Block a user