This PR contains changes to TxOrphanage needed for package relay stuff. See #27463 for project tracking and #28031 for how this code is used.
Separating this PR was suggested in #28031 (review).
Changes here:
- Change params to wtxid instead of txid.
- Track total size (CTransaction::GetTotalSize()of orphans stored, as well as the size per peer.
- Support having multiple announcers for the same tx. This helps us retry resolving the same orphan with multiple peers if it fails the first time.
- Store the deduplicated missing parent txids in OrphanTxso that we don’t need to calculate them again later on.
- Return the erased wtxids from EraseForBlockwhich includes orphans that conflicted with the block. This helps us delete those orphan resolution attempts from our tracker.
- Enable limiting the total size of orphans instead of just the total count. No new limits are introduced, the default is maximum count * maximum tx size.
- Unit tests + fuzzer.