Just 4 words added on getrawtransaction lookup error to fix #16142
getrawtransaction: inform about blockhash argument when lookup fails #16217
pull darosior wants to merge 1 commits into bitcoin:master from darosior:getrawtransaction_error_blockhash changing 1 files +1 −1-
darosior commented at 9:13 PM on June 14, 2019: member
-
getrawtransaction: inform about blockhash argument when lookup fails c59e3a3261
- fanquake added the label RPC/REST/ZMQ on Jun 14, 2019
-
in src/rpc/rawtransaction.cpp:199 in c59e3a3261
195 | @@ -196,7 +196,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request) 196 | } 197 | errmsg = "No such transaction found in the provided block"; 198 | } else if (!g_txindex) { 199 | - errmsg = "No such mempool transaction. Use -txindex to enable blockchain transaction queries"; 200 | + errmsg = "No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries";
promag commented at 11:11 PM on June 16, 2019:No strong opinion, but generally I think error messages shouldn't mention arguments or configurations, for that we have the help message.
instagibbs commented at 2:22 PM on June 17, 2019:Is that really a guideline? This seems very helpful, especially as the underlying API changes(no more UTXO lookup)
promag commented at 2:36 PM on June 17, 2019:For cli usage this might be useful, but for the developer what really matters IMO is the documentation and error code in the response.
I understand the issue regarding the API change, but I'd rather see a documentation improvement than having "hints" in the errors.
MarcoFalke commented at 11:15 AM on June 17, 2019: memberACK, could you also update the help text, so that this is not only shown on error?
darosior commented at 12:27 PM on June 17, 2019: member@MarcoFalke it's already in the help text : https://github.com/bitcoin/bitcoin/blob/c59e3a32614e627ba2834b032d4799eb69672155/src/rpc/rawtransaction.cpp#L78-L80
MarcoFalke merged this on Jun 17, 2019MarcoFalke closed this on Jun 17, 2019MarcoFalke referenced this in commit fce4123242 on Jun 17, 2019deadalnix referenced this in commit 3ba1a8b1e4 on Nov 11, 2020PastaPastaPasta referenced this in commit a278d04dda on Jun 27, 2021PastaPastaPasta referenced this in commit 5eb8091838 on Jun 28, 2021PastaPastaPasta referenced this in commit 238db1d552 on Jun 29, 2021PastaPastaPasta referenced this in commit 503d317db6 on Jul 1, 2021PastaPastaPasta referenced this in commit 881d3db5bc on Jul 1, 2021PastaPastaPasta referenced this in commit 1e1a292af0 on Jul 12, 2021PastaPastaPasta referenced this in commit 7eb9b7bcc9 on Jul 13, 2021DrahtBot locked this on Dec 16, 2021ContributorsLabels
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-13 15:14 UTC
More mirrored repositories can be found on mirror.b10c.me