HomePhabricator

txorphanage: Extract OrphanageAddTx and drop AddOrphanTx

Description

txorphanage: Extract OrphanageAddTx and drop AddOrphanTx

Summary:

txorphanage: Extract OrphanageAddTx

Extract code from AddOrphanTx into OrphanageAddTx.

https://github.com/bitcoin/bitcoin/pull/21148/commits/1041616d7eb66281bb4de51ffbc83df0923b2f7e

denialofservices_tests: check txorphanage's AddTx

Rather than checking net_processing's internal implementation of
AddOrphanTx, test txorphanage's exported AddTx interface. Note that
this means AddToCompactExtraTransactions is no longer tested here.

https://github.com/bitcoin/bitcoin/pull/21148/commits/26d1a6ccd5fcc7abec737c0d8c67238561627d59

net_processing: drop AddOrphanTx

All the interesting functionality of AddOrphanTx is already in other
functions, so call those functions directly in the one place that
AddOrphanTx was used.

https://github.com/bitcoin/bitcoin/pull/21148/commits/3c4c3c2fdda3a361e3802e97bc3566f815b75de1

This is a backport of core#21148 [7, 8 & 9/14]

Depends on D11486

Note: the way Core used the lock in denialofservice_tests depends on RandomOrphan not taking the locks, which Core does in a subsequent commit of the same PR.

Test Plan:
With clang and debug:

ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D11487

Details

Provenance
PiRKAuthored on May 18 2022, 08:40
PiRKPushed on May 19 2022, 16:07
Reviewer
Restricted Project
Differential Revision
D11487: txorphanage: Extract OrphanageAddTx and drop AddOrphanTx
Parents
rABC718ec9723107: txorphanage: Extract GetOrphanTx
Branches
Unknown
Tags
Unknown