mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Combine loops in CChainLocksHandler::NewPoWValidBlock
This commit is contained in:
parent
9e9081110b
commit
280690792a
@ -344,6 +344,8 @@ void CChainLocksHandler::NewPoWValidBlock(const CBlockIndex* pindex, const std::
|
||||
return;
|
||||
}
|
||||
|
||||
int64_t curTime = GetAdjustedTime();
|
||||
|
||||
// We listen for NewPoWValidBlock so that we can collect all TX ids of all included TXs of newly received blocks
|
||||
// We need this information later when we try to sign a new tip, so that we can determine if all included TXs are
|
||||
// safe.
|
||||
@ -357,13 +359,9 @@ void CChainLocksHandler::NewPoWValidBlock(const CBlockIndex* pindex, const std::
|
||||
}
|
||||
}
|
||||
txs->emplace(tx->GetHash());
|
||||
}
|
||||
blockTxs[pindex->GetBlockHash()] = txs;
|
||||
|
||||
int64_t curTime = GetAdjustedTime();
|
||||
for (auto& tx : block->vtx) {
|
||||
txFirstSeenTime.emplace(tx->GetHash(), curTime);
|
||||
}
|
||||
blockTxs[pindex->GetBlockHash()] = txs;
|
||||
}
|
||||
|
||||
void CChainLocksHandler::SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int posInBlock)
|
||||
|
Loading…
Reference in New Issue
Block a user