HomePhabricator

Fix a potential race in p2p_inv_download

Description

Fix a potential race in p2p_inv_download

Summary:
The occurrence can be seen here: https://build.bitcoinabc.org/viewLog.html?buildId=606857&buildTypeId=BitcoinABC_Master_BitcoinAbcMasterCoverage&tab=buildResultsDiv&guest=1

In the test_inv_tx case, node 0 sends a transaction to node 1 and the test looks into the log for node 1 to receive the tx inventory message. But the debug log lookup does not embed the tx relaying, so it might be received and the message printed before the test starts looking at the debug log.
In the example linked the tx is received as expected since the log shows that node 1 is requesting the data from node 0, but the expected inv message has been missed.

Test Plan:

./test/functional/test_runnner.py p2p_inv_download

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

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

Details

Provenance
FabienAuthored on Aug 25 2023, 10:49
FabienPushed on Aug 25 2023, 11:44
Reviewer
Restricted Project
Differential Revision
D14411: Fix a potential race in p2p_inv_download
Parents
rABC7b86690f9082: rpc: Keep default argument value in correct type
Branches
Unknown
Tags
Unknown