cs_main
when calling RelayTransactions()
from outside net_processing. Internally, we lock cs_main
and call an internal _RelayTransactions()
function that does require cs_main
.
cs_main
when calling RelayTransactions()
from outside net_processing. Internally, we lock cs_main
and call an internal _RelayTransactions()
function that does require cs_main
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
255@@ -256,6 +256,9 @@ class PeerManagerImpl final : public PeerManager
256 const std::chrono::microseconds time_received, const std::atomic<bool>& interruptMsgProc) override;
257
258 private:
259+ void _RelayTransaction(const uint256& txid, const uint256& wtxid)
260+ EXCLUSIVE_LOCKS_REQUIRED(cs_main);
9012512a57283bdcd0cc0562680d5de2f304af9f
Should include sync.h?
1017@@ -1015,7 +1018,7 @@ void PeerManagerImpl::ReattemptInitialBroadcast(CScheduler& scheduler)
1018
1019 if (tx != nullptr) {
1020 LOCK(cs_main);
1021- RelayTransaction(txid, tx->GetWitnessHash());
9012512a57283bdcd0cc0562680d5de2f304af9f
Remove the above lock instead?
cs_main
in _RelayTransaction()
with a new internal net_processing lock, and we’ll need to call the internal _RelayTransaction()
function here. It makes sense to keep this as it is for now.
Callers of the external RelayTransactions() no longer need to lock cs_main.
1514@@ -1511,6 +1515,11 @@ void PeerManagerImpl::SendPings()
1515 }
1516
1517 void PeerManagerImpl::RelayTransaction(const uint256& txid, const uint256& wtxid)
1518+{
1519+ WITH_LOCK(cs_main, _RelayTransaction(txid, wtxid););
;);
– there’s already a terminating ;
in the WITH_LOCK
#define
. Could just use a plain LOCK
instead of WITH_LOCK
too…
ACK 39e19713cd6594f93db835e8ef7eef5824a9ba02
please also help to review the conflicting pull requests
Hi, fellow reviewers of this PR…