Prevent rebroadcast of expired tx
This commit is contained in:
@@ -2102,12 +2102,21 @@ std::vector<uint256> CWallet::ResendWalletTransactionsBefore(int64_t nTime)
|
|||||||
LOCK(cs_wallet);
|
LOCK(cs_wallet);
|
||||||
// Sort them in chronological order
|
// Sort them in chronological order
|
||||||
multimap<unsigned int, CWalletTx*> mapSorted;
|
multimap<unsigned int, CWalletTx*> mapSorted;
|
||||||
|
uint32_t now = (uint32_t)time(NULL);
|
||||||
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
|
BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)& item, mapWallet)
|
||||||
{
|
{
|
||||||
CWalletTx& wtx = item.second;
|
CWalletTx& wtx = item.second;
|
||||||
// Don't rebroadcast if newer than nTime:
|
// Don't rebroadcast if newer than nTime:
|
||||||
if (wtx.nTimeReceived > nTime)
|
if (wtx.nTimeReceived > nTime)
|
||||||
continue;
|
continue;
|
||||||
|
if ( ASSETCHAINS_SYMBOL[0] == 0 )
|
||||||
|
{
|
||||||
|
if ( wtx.nLockTime >= LOCKTIME_THRESHOLD && wtx.nLockTime < now-KOMODO_MAXMEMPOOLTIME )
|
||||||
|
{
|
||||||
|
LogPrintf("skip Relaying wtx %s nLockTime %u vs now.%u\n", wtx.GetHash().ToString(),(uint32_t)wtx.nLockTime,now);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
|
mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
|
||||||
}
|
}
|
||||||
BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted)
|
BOOST_FOREACH(PAIRTYPE(const unsigned int, CWalletTx*)& item, mapSorted)
|
||||||
|
|||||||
Reference in New Issue
Block a user