Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Mar 31, 2022

No description provided.

Can be reviewed with
--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
@maflcko
Copy link
Member Author

maflcko commented Mar 31, 2022

Rendered diff is move-only:

diff --git a/getrawtransaction b/getrawtransaction
index e1a266d..ae73e6b 100644
--- a/getrawtransaction
+++ b/getrawtransaction
@@ -23,6 +23,10 @@ Result (if verbose is not set or set to false):
 Result (if verbose is set to true):
 {                                    (json object)
   "in_active_chain" : true|false,    (boolean, optional) Whether specified block is in the active chain or not (only present with explicit "blockhash" argument)
+  "blockhash" : "hex",               (string, optional) the block hash
+  "confirmations" : n,               (numeric, optional) The confirmations
+  "blocktime" : xxx,                 (numeric, optional) The block time expressed in UNIX epoch time
+  "time" : n,                        (numeric, optional) Same as "blocktime"
   "hex" : "hex",                     (string) The serialized, hex-encoded data for 'txid'
   "txid" : "hex",                    (string) The transaction id (same as provided)
   "hash" : "hex",                    (string) The transaction hash (differs from txid for witness transactions)
@@ -61,11 +65,7 @@ Result (if verbose is set to true):
       }
     },
     ...
-  ],
-  "blockhash" : "hex",               (string, optional) the block hash
-  "confirmations" : n,               (numeric, optional) The confirmations
-  "blocktime" : xxx,                 (numeric, optional) The block time expressed in UNIX epoch time
-  "time" : n                         (numeric, optional) Same as "blocktime"
+  ]
 }
 
 Examples:

Copy link
Member

@fanquake fanquake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa58427

Copy link
Contributor

@shaavan shaavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK fa58427

  • This newly introduced helper function, DecodeTxDoc, helps display all the text in the RPC help message for getting a transaction and decoderawtransaction.
  • Since almost all the text in both of these functions help message is the same, this function helps remove the redundant lines of code while ensuring consistency in the displayed message for both these RPC commands.
  • I compiled the PR successfully, and I was able to verify that the displayed RPC help message is unchanged.

Screenshot:
PR

@shaavan
Copy link
Contributor

shaavan commented Mar 31, 2022

I want to bring a point to notice. While compiling the PR, I got a bunch of repeated (same) warnings, whose screenshot I am adding here.

Issue

Since this doesn't seem relevant to this PR, I am adding it as a separate comment. I am running bitcoin core on Ubuntu 20.04. I am not sure if this is a genuine issue or my system's fault.

@maflcko
Copy link
Member Author

maflcko commented Mar 31, 2022

See #24714 (comment) for the gcc-8 and gcc-9 bug

@maflcko maflcko merged commit 243197b into bitcoin:master Mar 31, 2022
@maflcko maflcko deleted the 2203-doc-rpc-raw-tx-🚁 branch March 31, 2022 14:00
@laanwj
Copy link
Member

laanwj commented Mar 31, 2022

Post-merge ACK

Copy link
Contributor

@w0xlt w0xlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Post-merge ACK

sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Apr 3, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Mar 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants