Skip to content

Commit 23aef28

Browse files
committed
Allow negative confirmations with blocks endpoints
getblock and getblockheader returns -1 as confirmations if the block is not on the main chain
1 parent ac1e31e commit 23aef28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl Eq for ScanningDetails {}
171171
#[serde(rename_all = "camelCase")]
172172
pub struct GetBlockResult {
173173
pub hash: bitcoin::BlockHash,
174-
pub confirmations: u32,
174+
pub confirmations: i32,
175175
pub size: usize,
176176
pub strippedsize: Option<usize>,
177177
pub weight: usize,
@@ -197,7 +197,7 @@ pub struct GetBlockResult {
197197
#[serde(rename_all = "camelCase")]
198198
pub struct GetBlockHeaderResult {
199199
pub hash: bitcoin::BlockHash,
200-
pub confirmations: u32,
200+
pub confirmations: i32,
201201
pub height: usize,
202202
pub version: i32,
203203
#[serde(default, with = "::serde_hex::opt")]

0 commit comments

Comments
 (0)