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