If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
DrahtBot added the label Docs on Jan 24, 2024
ismaelsadeeq renamed this: doc: clarify that `BroadcastTransaction` comment doc: clarify `BroadcastTransaction` comment on Jan 24, 2024
ismaelsadeeq force-pushed on Jan 24, 2024
vasild approved
vasild
commented at 3:52 PM on January 24, 2024:
contributor
ACKcca20d94b787d0881a61509445f4827f913e051d
I was looking at the same comment and was thinking it needs an update. Thanks!
BrandonOdiwuor approved
BrandonOdiwuor
commented at 6:47 PM on January 24, 2024:
contributor
lgtm ACKcca20d94b787d0881a61509445f4827f913e051d
kristapsk approved
kristapsk
commented at 6:54 PM on January 24, 2024:
contributor
ACKcca20d94b787d0881a61509445f4827f913e051d
willcl-ark approved
willcl-ark
commented at 8:47 PM on January 24, 2024:
member
ACKcca20d94b787d0881a61509445f4827f913e051d
in
src/node/transaction.cpp:35
in
cca20d94b7outdated
31 | @@ -32,7 +32,7 @@ static TransactionError HandleATMPError(const TxValidationState& state, std::str
32 |
33 | TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef tx, std::string& err_string, const CAmount& max_tx_fee, bool relay, bool wait_callback)
34 | {
35 | - // BroadcastTransaction can be called by either sendrawtransaction RPC or the wallet. 36 | + // BroadcastTransaction can be called by sendrawtransaction RPC, submitpackage RPC or the wallet.
stickies-v
commented at 11:11 AM on January 25, 2024:
I don't think we care about which specific RPCs call it? Would just mention that it can be called by RPC, that's the key info - and more maintainable.
// BroadcastTransaction can be called by RPC or by the wallet.
(this is heading in the direction of "amount of discussion is inversely proportional to the complexity of the change")
When working on another PR, I found this comment useful and I cared with RPC called the function. Surely there are other means to check who is calling a given function, but this comment gives a quick concise answer at a glance. To be useful it has to be precise and elaborate. If it is vague then it is less useful and it might as well be removed completely.
stickies-v
commented at 11:29 AM on January 25, 2024:
Extending that logic, should we document all the call sites of each helper function that's used by RPCs because it can be helpful sometimes? That seems abnormal to me. I understood the only relevance of this line to be in relation to the next one: "chainman, mempool and peerman are initialized before the RPC server and wallet are started". For this, it doesn't matter which RPCs call it.
kristapsk
commented at 11:32 AM on January 25, 2024:
BroadcastTransaction() is not just any helper function, it may irreversibly affect user's privacy.
ismaelsadeeq
commented at 10:44 PM on January 25, 2024:
I think BroadcastTransaction can be called by RPC or by the wallet is ambiguous in this case.
By which RPC?
If I understand the rationale behind this comment correctly, it's specifically indicating who is currently calling the function, that is sendrawtransaction, submitpackage RPC, and the wallet
But if the rationale is indicating the generic meaning of who can invoke BroadcastTransaction, then yes, I agree it would be even more maintainable to simply delete the comment?
I agree with @stickies-v that listing all the callers of a function within code documentation is not maintainable. This should not be something that a developer relies on and is what a grepper / search bar is for. If it's confusing that not all RPCs are listed, I'd be in favor of just deleting the names of the RPCs that use this function, as it doesn't matter to the comment.
ismaelsadeeq
commented at 9:44 AM on January 26, 2024:
Deleted the comment, and updated the PR description.
stickies-v
commented at 8:55 PM on January 26, 2024:
I don't understand why we'd delete it entirely either. It belongs together with the next sentence. I suppose it can be deduced from it too, but the current approach doesn't seem like an improvement to me. I still think my suggested phrasing works best from what I've seen so far. I don't think it's ambiguous, it just doesn't specify which RPC is called, which is irrelevant to the rest of the documentation and as such we shouldn't make it look like it isn't.
ismaelsadeeq
commented at 12:10 PM on January 29, 2024:
Yes I agree with your point.
Reverting back with your initial suggestion.
ismaelsadeeq renamed this: doc: clarify `BroadcastTransaction` comment doc: update `BroadcastTransaction` comment on Jan 26, 2024
shaavan approved
shaavan
commented at 12:51 PM on January 26, 2024:
contributor
ACK437e8eb219c461d27c73a85e0c57d8e11b72a85d
Following the discussion in the PR so far, I agree that it is more logical and maintainable not to detail which function calls (or can call) a particular function since this information is easily accessible through other methods (e.g. by using an IDE)
That's why I think it's best to remove the comment.
DrahtBot requested review from willcl-ark on Jan 26, 2024
DrahtBot requested review from kristapsk on Jan 26, 2024
DrahtBot requested review from vasild on Jan 26, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 26, 2024
DrahtBot removed review request from kristapsk on Jan 26, 2024
DrahtBot removed review request from BrandonOdiwuor on Jan 26, 2024
DrahtBot requested review from kristapsk on Jan 26, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 26, 2024
DrahtBot removed review request from kristapsk on Jan 26, 2024
DrahtBot removed review request from BrandonOdiwuor on Jan 26, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 26, 2024
DrahtBot requested review from kristapsk on Jan 26, 2024
doc: update `BroadcastTransaction` comment
BroadcastTransaction is also called by submitpackage RPC.
It's not maintainable to list all the callers of a function.
31cce4a1bd
ismaelsadeeq force-pushed on Jan 29, 2024
stickies-v approved
stickies-v
commented at 12:54 PM on January 29, 2024:
contributor
ACK31cce4a1bdbb48f57996615ee6c686e456cc0bea
DrahtBot removed review request from BrandonOdiwuor on Jan 29, 2024
DrahtBot removed review request from kristapsk on Jan 29, 2024
DrahtBot requested review from shaavan on Jan 29, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 29, 2024
DrahtBot requested review from kristapsk on Jan 29, 2024
kristapsk approved
kristapsk
commented at 1:09 PM on January 29, 2024:
contributor
ACK31cce4a1bdbb48f57996615ee6c686e456cc0bea
DrahtBot removed review request from shaavan on Jan 29, 2024
DrahtBot removed review request from BrandonOdiwuor on Jan 29, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 29, 2024
DrahtBot requested review from shaavan on Jan 29, 2024
naumenkogs approved
naumenkogs
commented at 9:04 AM on January 30, 2024:
member
ACK31cce4a1bdbb48f57996615ee6c686e456cc0bea
DrahtBot removed review request from BrandonOdiwuor on Jan 30, 2024
DrahtBot removed review request from shaavan on Jan 30, 2024
DrahtBot requested review from BrandonOdiwuor on Jan 30, 2024
DrahtBot requested review from shaavan on Jan 30, 2024
glozow merged this on Jan 30, 2024
glozow closed this on Jan 30, 2024
ismaelsadeeq deleted the branch on Jun 27, 2024
PastaPastaPasta referenced this in commit 0e2893a689 on Oct 24, 2024
PastaPastaPasta referenced this in commit 5045b35a96 on Oct 24, 2024
PastaPastaPasta referenced this in commit 3599458cd7 on Oct 24, 2024
PastaPastaPasta referenced this in commit 8bf1d06599 on Oct 24, 2024
PastaPastaPasta referenced this in commit a67319351a on Oct 24, 2024
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me