mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
[mempool] Revert unbroadcast set to tracking just txid
When I originally implemented the unbroadcast set in 18038, it just tracked txids. After 18038 was merged, I offered a patch to 18044 to make the unbroadcast changes compatible with wtxid relay. In this patch, I updated `unbroadcast_txids` to a map of txid -> wtxid. Post merge review comments shed light on the fact that this update was unnecessary, and distracting. So, this commit updates the unbroadcast ids back to a set.
This commit is contained in:
@@ -889,15 +889,16 @@ void PeerLogicValidation::InitializeNode(CNode *pnode) {
|
||||
|
||||
void PeerLogicValidation::ReattemptInitialBroadcast(CScheduler& scheduler) const
|
||||
{
|
||||
std::map<uint256, uint256> unbroadcast_txids = m_mempool.GetUnbroadcastTxs();
|
||||
std::set<uint256> unbroadcast_txids = m_mempool.GetUnbroadcastTxs();
|
||||
|
||||
for (const auto& elem : unbroadcast_txids) {
|
||||
// Sanity check: all unbroadcast txns should exist in the mempool
|
||||
if (m_mempool.exists(elem.first)) {
|
||||
for (const auto& txid : unbroadcast_txids) {
|
||||
CTransactionRef tx = m_mempool.get(txid);
|
||||
|
||||
if (tx != nullptr) {
|
||||
LOCK(cs_main);
|
||||
RelayTransaction(elem.first, elem.second, m_connman);
|
||||
RelayTransaction(txid, tx->GetWitnessHash(), m_connman);
|
||||
} else {
|
||||
m_mempool.RemoveUnbroadcastTx(elem.first, true);
|
||||
m_mempool.RemoveUnbroadcastTx(txid, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user