Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mediantime to getblockchaininfo #7011

Merged

Conversation

@petertodd
Copy link
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 2 commits 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.
@gmaxwell
Copy link
Contributor

gmaxwell commented Nov 13, 2015

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

@paveljanik

This comment has been minimized.

Copy link

paveljanik commented on src/rpcblockchain.cpp in 748321e Nov 13, 2015

This needs corresponding update to getblockchaininfo help text.

This comment has been minimized.

Copy link
Owner Author

petertodd replied Nov 13, 2015

Doh! Fixed.

petertodd added 2 commits Nov 13, 2015
@petertodd
Copy link
Contributor Author

petertodd commented Nov 13, 2015

@gmaxwell Good idea; done.

@gmaxwell
Copy link
Contributor

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
Copy link
Contributor

paveljanik commented Nov 14, 2015

ACK

@laanwj laanwj added the RPC/REST/ZMQ label Nov 14, 2015
@MarcoFalke
Copy link
Member

MarcoFalke commented Nov 14, 2015

utACK

@petertodd
Copy link
Contributor Author

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
Copy link
Contributor

gmaxwell commented Nov 14, 2015

Fair enough.

@gmaxwell
Copy link
Contributor

gmaxwell commented Nov 21, 2015

ACK.

@gmaxwell gmaxwell merged commit 6531f17 into bitcoin:master Nov 21, 2015
1 check passed
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
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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.