Document max time field correctly (#5773)

This commit is contained in:
teor 2022-12-02 11:38:17 +10:00 committed by GitHub
parent 21c916f5fa
commit d9b941bda7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -110,12 +110,19 @@ pub struct GetBlockTemplate {
// TODO: use Height type?
pub height: u32,
/// > the maximum time allowed
///
/// <https://en.bitcoin.it/wiki/BIP_0023#Mutations>
///
/// Zebra adjusts the minimum and current times for testnet minimum difficulty blocks,
/// so we need to tell miners what the maximum valid time is.
///
/// This field is not in the Zcash RPC reference yet.
/// Currently, miners use `min_time` or `cur_time`, or calculate `max_time` from the
/// fixed 90 minute consensus rule. (Or they just don't check!)
///
/// Currently, some miners just use `min_time` or `cur_time`. Others calculate `max_time` from the
/// fixed 90 minute consensus rule, or a smaller fixed interval (like 1000s).
/// Some miners don't check the maximum time. This can cause invalid blocks after network downtime,
/// a significant drop in the hash rate, or after the testnet minimum difficulty interval.
#[serde(rename = "maxtime")]
// TODO: use DateTime32 type?
pub max_time: i64,