Skip to content

Commit fcd37d3

Browse files
committed
Update the docs for GetBlockStats
GetBlockStats takes a second optional argument `stats`, which defaults to all if not provided, but if provided, `getblockstats` returns only the value of the stats requested. Remove copy paste error from the past which included docs from `getblockcount` in the documentation for `getblockstats`.
1 parent 2dcc0a5 commit fcd37d3

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

types/src/v17/blockchain/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,16 +279,19 @@ pub struct GetBlockHeaderVerbose {
279279
/// Result of JSON-RPC method `getblockstats`.
280280
///
281281
/// > getblockstats hash_or_height ( stats )
282-
///
283-
/// > Returns the number of blocks in the longest blockchain.
284-
/// > getblockstats hash_or_height ( stats )
285282
/// >
286283
/// > Compute per block statistics for a given window. All amounts are in satoshis.
287284
/// > It won't work for some heights with pruning.
288285
/// > It won't work without -txindex for utxo_size_inc, *fee or *feerate stats.
289286
/// >
290287
/// > Arguments:
291288
/// > 1. "hash_or_height" (string or numeric, required) The block hash or height of the target block
289+
/// > 2. "stats" (json array, optional, default=all values) Values to plot (see result below)
290+
/// > [
291+
/// > "height", (string) Selected statistic
292+
/// > "time", (string) Selected statistic
293+
/// > ...
294+
/// > ]
292295
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
293296
#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
294297
pub struct GetBlockStats {

types/src/v25/blockchain/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ pub use super::{GetBlockStatsError, ScanTxOutSetError};
1515
/// Result of JSON-RPC method `getblockstats`.
1616
///
1717
/// > getblockstats hash_or_height ( stats )
18-
///
19-
/// > Returns the number of blocks in the longest blockchain.
20-
/// > getblockstats hash_or_height ( stats )
2118
/// >
2219
/// > Compute per block statistics for a given window. All amounts are in satoshis.
2320
/// > It won't work for some heights with pruning.
2421
/// > It won't work without -txindex for utxo_size_inc, *fee or *feerate stats.
2522
/// >
2623
/// > Arguments:
2724
/// > 1. "hash_or_height" (string or numeric, required) The block hash or height of the target block
25+
/// > 2. "stats" (json array, optional, default=all values) Values to plot (see result below)
26+
/// > [
27+
/// > "height", (string) Selected statistic
28+
/// > "time", (string) Selected statistic
29+
/// > ...
30+
/// > ]
2831
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2932
#[cfg_attr(feature = "serde-deny-unknown-fields", serde(deny_unknown_fields))]
3033
pub struct GetBlockStats {

0 commit comments

Comments
 (0)