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 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?

@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

@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
gmaxwell added a commit that referenced this issue 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)
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants