John Newbery
9190b01d8d
[net processing] Add Orphanage empty consistency check
...
When removing the final peer, assert that m_tx_orphanage is empty.
2021-07-20 13:12:42 +01:00
Yerzhan Mazhkenov
94c7dd9ac8
doc: Fix typos from codespell lint
2021-04-07 19:26:25 +01:00
MarcoFalke
fa5eabe721
refactor: Remove negative lock annotations from globals
2021-04-05 08:42:15 +02:00
Anthony Towns
5e50e2d1b9
txorphanage: comment improvements
2021-03-02 19:40:11 +10:00
Anthony Towns
f8c0688b94
scripted-diff: Update txorphanage naming convention
...
-BEGIN VERIFY SCRIPT-
sed -i 's/mapOrphanTransactionsByPrev/m_outpoint_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/mapOrphanTransactions/m_orphans/g' src/txorphanage.h src/txorphanage.cpp src/net_processing.cpp src/test/denialofservice_tests.cpp
sed -i 's/g_orphan_list/m_orphan_list/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/g_orphans_by_wtxid/m_wtxid_to_orphan_it/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/nMaxOrphans/max_orphans/g' src/txorphanage.h src/txorphanage.cpp
sed -i 's/COrphanTx/OrphanTx/g' src/txorphanage.h src/txorphanage.cpp src/test/denialofservice_tests.cpp
-END VERIFY SCRIPT-
2021-02-27 01:08:09 +10:00
Anthony Towns
6bd4963c06
txorphanage: Move functions and data into class
...
Collects all the orphan handling globals into a single member var in
net_processing, and ensures access is encapuslated into the interface
functions. Also adds doxygen comments for methods.
2021-02-27 01:07:55 +10:00
Anthony Towns
03257b832d
txorphanage: Extract EraseOrphansForBlock
...
Extract code that erases orphans when a new block is found into
EraseOrphansForBlock.
2021-02-27 00:31:09 +10:00
Anthony Towns
1041616d7e
txorphanage: Extract OrphanageAddTx
...
Extract code from AddOrphanTx into OrphanageAddTx.
2021-02-26 23:55:10 +10:00
Anthony Towns
f294da7274
txorphanage: Extract GetOrphanTx
...
Extract orphan lookup code into GetOrphanTx function.
2021-02-26 23:55:10 +10:00
Anthony Towns
83679ffc60
txorphanage: Extract HaveOrphanTx
...
Extract some common code into HaveOrphanTx function.
2021-02-26 23:55:10 +10:00
Anthony Towns
ee135c8d5b
txorphanage: Extract AddChildrenToWorkSet
...
Extract some common code into AddChildrenToWorkSet function.
(It's a hard knock life)
2021-02-26 23:55:10 +10:00
Anthony Towns
38a11c355a
txorphanage: Add lock annotations
...
EraseOrphansFor was called both with and without g_cs_orphans held,
correct that so that it's always called with it already held.
LimitOrphanTxSize was always called with g_cs_orphans held, so
add annotations and don't lock it a second time.
2021-02-26 23:55:10 +10:00
Anthony Towns
81dd57e5b1
txorphanage: Pass uint256 by reference instead of value
2021-02-26 23:55:07 +10:00
Anthony Towns
9d5313df7e
move-only: Add txorphanage module
...
This module captures orphan tracking code for tx relay.
Can be reviewed with --color-moved=dimmed-zebra
2021-02-26 23:55:03 +10:00