| 1537 | } |
| 1538 | |
| 1539 | void PeerManagerImpl::BlockDisconnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex* pindex) |
| 1540 | { |
| 1541 | // To avoid relay problems with transactions that were previously |
| 1542 | // confirmed, clear our filter of recently confirmed transactions whenever |
| 1543 | // there's a reorg. |
| 1544 | // This means that in a 1-block reorg (where 1 block is disconnected and |
| 1545 | // then another block reconnected), our filter will drop to having only one |
| 1546 | // block's worth of transactions in it, but that should be fine, since |
| 1547 | // presumably the most common case of relaying a confirmed transaction |
| 1548 | // should be just after a new block containing it is found. |
| 1549 | LOCK(m_recent_confirmed_transactions_mutex); |
| 1550 | m_recent_confirmed_transactions.reset(); |
| 1551 | } |
| 1552 | |
| 1553 | // All of the following cache a recent block, and are protected by cs_most_recent_block |
| 1554 | static RecursiveMutex cs_most_recent_block; |