HomePhabricator

[backport#19178] Make mininode_lock non-reentrant

Description

[backport#19178] Make mininode_lock non-reentrant

Summary:
https://github.com/bitcoin/bitcoin/pull/19178/commits/edae6075aa3b1169c84b65e76fd48d68242a294e
[tests] Only acquire lock once in p2p_compactblocks.py

https://github.com/bitcoin/bitcoin/pull/19178/commits/9d80762fa0931fe553fad241e95bcc1515ef0e95
[tests] Don't acquire mininode_lock twice in wait_for_broadcast()

https://github.com/bitcoin/bitcoin/pull/19178/commits/c67c1f2c032a8efa141d776a7e5be58f052159ea
[tests] Make mininode_lock non-reentrant

Commit c67c1f2c032a8efa141d776a7e5be58f052159ea removing a double call to the parent method in P2PTxInvStore.on_inv is not relevant for Bitcoin ABC, as it fixes a bug that was never introduced in our codebase. We skipped that commit while backporting core#18807.

To make it work, the following additional change is needed for Bitcoin ABC:
Don't acquire mininode_lock twice in abc_p2p_avalanche.py. on_avahello, on_avapoll and on_avaresponse are called indirectly via mininode.P2PInterface.on_message, whit the lock already acquired.

This is a backport of core#19178

Test Plan: ninja check-functional

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Subscribers: deadalnix

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

Details

Provenance
John Newbery <john@johnnewbery.com>Authored on Jun 5 2020, 14:57
PiRKCommitted on Apr 23 2021, 08:53
PiRKPushed on Apr 23 2021, 08:53
Reviewer
Restricted Project
Differential Revision
D9430: [backport#19178] Make mininode_lock non-reentrant
Parents
rABC2335099e03a5: [avalanche] Don't turn on service bit if we don't have a proof
Branches
Unknown
Tags
Unknown