Bitcoin Forum
July 06, 2024, 09:33:33 AM *
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 478 times)
CIYAM (OP)
Legendary
*
Offline Offline

Activity: 1890
Merit: 1078


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
gmaxwell
Staff
Legendary
*
Offline Offline

Activity: 4200
Merit: 8443



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!