-
Notifications
You must be signed in to change notification settings - Fork 228
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
fix: calculate the current median time from tip #878
fix: calculate the current median time from tip #878
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hold as requested by @keroro520.
@TheWaWaR is assigned as the leading reviewer |
Block by #854 |
@nervos-bot-user ci status e3e203a Sync status |
@nervos-bot-user ci status e3e203a Sync status, again. |
545dcd0
to
2884673
Compare
2884673
to
91b3949
Compare
Original implementation use [Tip-BlockMedianCount .. Tip-1] to calculate the current block median time. According to the notion of BlockMedianTime in https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki#specification , here change to use [Tip-BlockMedianCount+1 .. Tip] instead.
91b3949
to
1977439
Compare
|
||
pub fn since_from_absolute_block_number(block_number: BlockNumber) -> u64 { | ||
FLAG_SINCE_BLOCK_NUMBER | block_number | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those functions should add to enum SinceMetric
and should use in send_transaction
RPC in the future.
BREAKING CHANGE: Original implementation use
[Tip-BlockMedianCount .. Tip-1]
to calculate the current block median time. According to the notion of BlockMedianTime in bip-0113 , here change to use[Tip-BlockMedianCount+1 .. Tip]
instead.