FIFO selection wallet.cpp
This wallet.cpp version selects the UTXOs based on FIFO i.e, the coins received first will be spent first
This commit is contained in:
parent
51293f733e
commit
235f78b0c1
@ -2461,6 +2461,7 @@ bool CWallet::SelectCoins(const std::vector<COutput>& vAvailableCoins, const CAm
|
|||||||
/*This selectCoins function selects the coins (UTXOs) in FIFO order i.e, the coins that is received first will be sent to spending first*/
|
/*This selectCoins function selects the coins (UTXOs) in FIFO order i.e, the coins that is received first will be sent to spending first*/
|
||||||
|
|
||||||
//get the received time of each coin and store in set time (using set because the content will be automatically stored in ascending order of the data)
|
//get the received time of each coin and store in set time (using set because the content will be automatically stored in ascending order of the data)
|
||||||
|
|
||||||
std::vector<COutput> vCoinsTmp(vAvailableCoins);
|
std::vector<COutput> vCoinsTmp(vAvailableCoins);
|
||||||
std::vector<COutput>::iterator it;
|
std::vector<COutput>::iterator it;
|
||||||
std::set<unsigned int> time;
|
std::set<unsigned int> time;
|
||||||
@ -4372,3 +4373,4 @@ bool CMerkleTx::AcceptToMemoryPool(const CAmount& nAbsurdFee, CValidationState&
|
|||||||
{
|
{
|
||||||
return ::AcceptToMemoryPool(mempool, state, tx, true, nullptr, nullptr, false, nAbsurdFee);
|
return ::AcceptToMemoryPool(mempool, state, tx, true, nullptr, nullptr, false, nAbsurdFee);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user