HomePhabricator

Make `node::BroadcastTransaction` take `const NodeContext &`, remove unused…

Description

Make node::BroadcastTransaction take const NodeContext &, remove unused Config param

Summary:
This helps with broadcasting txs from Chronik, which only has a const NodeContext & and no const Config &. Broadcasting from Chronik becomes more important once SLP is added.

Currently BroadcastTransaction takes a mutable NodeContext &, however, the mutability is not required by any of the functions called on it. It also takes a const Config & param, but that is unused, so we remove it.

Making it const is still thread safe as BroadcastTransaction takes a LOCK(cs_main), and RelayTransaction (which isn't covered by that lock) has an internal per-node lock (see CNode::PushTxInventory and PeerManagerImpl::RelayTransaction).

Test Plan: ninja check-functional

Reviewers: Fabien, #bitcoin_abc

Reviewed By: Fabien, #bitcoin_abc

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

Details

Provenance
tobias_ruckAuthored on Jun 4 2023, 18:48
tobias_ruckPushed on Jun 5 2023, 09:33
Reviewer
Restricted Project
Differential Revision
D13980: Make `node::BroadcastTransaction` take `const NodeContext &`, remove unused `Config` param
Parents
rABC4a25d89178be: [guix] bump glibc to 2.8
Branches
Unknown
Tags
Unknown