Add mediantime to getblockchaininfo #7011

Merged
merged 4 commits into from Nov 21, 2015

Conversation

Projects
None yet
5 participants
@petertodd
Contributor

petertodd commented Nov 13, 2015

Useful now that BIP113 is enforced for transactions entering the mempool. Was previously only (indirectly) available by calling getblocktemplate, a relatively expensive RPC call.

Also, clarified a comment in CheckFinalTx()

petertodd added some commits Nov 13, 2015

Add mediantime field to getblockchaininfo RPC call
Useful now that BIP113 is enforced for transactions entering the
mempool. Was previously only (indirectly) available by calling
getblocktemplate, a relatively expensive RPC call.
@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Nov 13, 2015

Member

Do we also want to add the value to the verbose getblock output?

Member

gmaxwell commented Nov 13, 2015

Do we also want to add the value to the verbose getblock output?

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 13, 2015

This needs corresponding update to getblockchaininfo help text.

This needs corresponding update to getblockchaininfo help text.

This comment has been minimized.

Show comment
Hide comment
@petertodd

petertodd Nov 13, 2015

Owner

Doh! Fixed.

Owner

petertodd replied Nov 13, 2015

Doh! Fixed.

petertodd added some commits Nov 13, 2015

@petertodd

This comment has been minimized.

Show comment
Hide comment
@petertodd

petertodd Nov 13, 2015

Contributor

@gmaxwell Good idea; done.

Contributor

petertodd commented Nov 13, 2015

@gmaxwell Good idea; done.

@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Nov 14, 2015

Member

Tested ACK.. but a question: are people going to get confused when they see median time in getblock output, but the nlock time thats enforced there is the mediantimepast?

Member

gmaxwell commented Nov 14, 2015

Tested ACK.. but a question: are people going to get confused when they see median time in getblock output, but the nlock time thats enforced there is the mediantimepast?

@paveljanik

This comment has been minimized.

Show comment
Hide comment
@paveljanik

paveljanik Nov 14, 2015

Contributor

ACK

Contributor

paveljanik commented Nov 14, 2015

ACK

@laanwj laanwj added the RPC/REST/ZMQ label Nov 14, 2015

@MarcoFalke

This comment has been minimized.

Show comment
Hide comment
@MarcoFalke

MarcoFalke Nov 14, 2015

Member

utACK

Member

MarcoFalke commented Nov 14, 2015

utACK

@petertodd

This comment has been minimized.

Show comment
Hide comment
@petertodd

petertodd Nov 14, 2015

Contributor

@gmaxwell They probably will be. OTOH, they can always check the mediantime for the previous block. Also, this way avoids the special case for the genesis block.

edit: Also, if it's the mediantimepast, how do I get the mediantime for the current block? I'd have to special-case calling getblockchaininfo, and that might refer to a newer block than I was expecting.

Contributor

petertodd commented Nov 14, 2015

@gmaxwell They probably will be. OTOH, they can always check the mediantime for the previous block. Also, this way avoids the special case for the genesis block.

edit: Also, if it's the mediantimepast, how do I get the mediantime for the current block? I'd have to special-case calling getblockchaininfo, and that might refer to a newer block than I was expecting.

@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Nov 14, 2015

Member

Fair enough.

Member

gmaxwell commented Nov 14, 2015

Fair enough.

@gmaxwell

This comment has been minimized.

Show comment
Hide comment
@gmaxwell

gmaxwell Nov 21, 2015

Member

ACK.

Member

gmaxwell commented Nov 21, 2015

ACK.

@gmaxwell gmaxwell merged commit 6531f17 into bitcoin:master Nov 21, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

gmaxwell added a commit that referenced this pull request Nov 21, 2015

Merge pull request #7011
6531f17 Add mediantime field to getblock and getblockheader (Peter Todd)
7259769 Document new mediantime field in getblockchaininfo (Peter Todd)
c277a63 Clarify nLockTime-by-time comment in CheckFinalTx() (Peter Todd)
748321e Add mediantime field to getblockchaininfo RPC call (Peter Todd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment