Bitcoin Forum
May 03, 2024, 08:19:56 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: RPC method to determine nBlocktime?  (Read 475 times)
CIYAM (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1075


Ian Knowles - CIYAM Lead Developer


View Profile WWW
November 15, 2016, 08:50:28 AM
 #1

In order to determine the current block height one can call getblockcount but I see no equivalent in order to determine the value used for nBlocktime (the average time of the last six blocks if I recall correctly).

When determining when a CLTV transaction is going to be "ready to send" (without actually attempting to send it) this would be helpful.

Or is there already a method to determine this from RPC calls?

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
1714767596
Hero Member
*
Offline Offline

Posts: 1714767596

View Profile Personal Message (Offline)

Ignore
1714767596
Reply with quote  #2

1714767596
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714767596
Hero Member
*
Offline Offline

Posts: 1714767596

View Profile Personal Message (Offline)

Ignore
1714767596
Reply with quote  #2

1714767596
Report to moderator
1714767596
Hero Member
*
Offline Offline

Posts: 1714767596

View Profile Personal Message (Offline)

Ignore
1714767596
Reply with quote  #2

1714767596
Report to moderator
1714767596
Hero Member
*
Offline Offline

Posts: 1714767596

View Profile Personal Message (Offline)

Ignore
1714767596
Reply with quote  #2

1714767596
Report to moderator
gmaxwell
Staff
Legendary
*
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
November 15, 2016, 11:01:47 AM
 #2

In order to determine the current block height one can call getblockcount but I see no equivalent in order to determine the value used for nBlocktime (the average time of the last six blocks if I recall correctly).
When determining when a CLTV transaction is going to be "ready to send" (without actually attempting to send it) this would be helpful.
Or is there already a method to determine this from RPC calls?


$ ~/bitcoin/src/bitcoin-cli getblockchaininfo
{
  "chain": "main",
  "blocks": 439009,
  "headers": 439009,
  "bestblockhash": "0000000000000000004b21e8d764c7b8d46cdda8d65de23f16ff2a0124ca9070",
  "difficulty": 254620187304.0614,
  "mediantime": 1479204735,
  "verificationprogress": 0.9999974299335723,
  "chainwork": "0000000000000000000000000000000000000000002eb229f12576c1dbb64496",
  "pruned": false,
  "softforks": [
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!