diff --git a/chaincfg/mainnetparams.go b/chaincfg/mainnetparams.go index bfd30239..4a365d53 100644 --- a/chaincfg/mainnetparams.go +++ b/chaincfg/mainnetparams.go @@ -116,6 +116,16 @@ func MainNetParams() *Params { {601900, newHashFromStr("00000000000000001c1865a45a038bb680fc076d70cd88c1843e3e669cb54942")}, }, + // AssumeValid is the hash of a block that has been externally verified + // to be valid. It allows several validation checks to be skipped for + // blocks that are both an ancestor of the assumed valid block and an + // ancestor of the best header. This is intended to be updated + // periodically with new releases. + // + // Block 00000000000000001251efb83ad1a5c71351b50fe9195f009cf0bf5a7cd99d52 + // Height: 606000 + AssumeValid: *newHashFromStr("00000000000000001251efb83ad1a5c71351b50fe9195f009cf0bf5a7cd99d52"), + // MinKnownChainWork is the minimum amount of known total work for the // chain at a given point in time. This is intended to be updated // periodically with new releases. diff --git a/chaincfg/params.go b/chaincfg/params.go index c19f050f..1ce05356 100644 --- a/chaincfg/params.go +++ b/chaincfg/params.go @@ -335,6 +335,13 @@ type Params struct { // will likely be changed to only allow a single checkpoint in the future. Checkpoints []Checkpoint + // AssumeValid is the hash of a block that has been externally verified to + // be valid. It allows several validation checks to be skipped for blocks + // that are both an ancestor of the assumed valid block and an ancestor of + // the best header. This is intended to be updated periodically with new + // releases. It may not be set for networks that do not require it. + AssumeValid chainhash.Hash + // MinKnownChainWork is the minimum amount of known total work for the chain // at a given point in time. This is intended to be updated periodically // with new releases. It may be nil for networks that do not require it. diff --git a/chaincfg/regnetparams.go b/chaincfg/regnetparams.go index e4aa30ff..8f2cf9fe 100644 --- a/chaincfg/regnetparams.go +++ b/chaincfg/regnetparams.go @@ -112,6 +112,12 @@ func RegNetParams() *Params { // Checkpoints ordered from oldest to newest. Checkpoints: nil, + // AssumeValid is the hash of a block that has been externally verified + // to be valid. + // + // Not set for regression test network since its chain is dynamic. + AssumeValid: chainhash.Hash{}, + // MinKnownChainWork is the minimum amount of known total work for the // chain at a given point in time. // diff --git a/chaincfg/simnetparams.go b/chaincfg/simnetparams.go index 43763ad6..a18e5a79 100644 --- a/chaincfg/simnetparams.go +++ b/chaincfg/simnetparams.go @@ -111,6 +111,12 @@ func SimNetParams() *Params { // Checkpoints ordered from oldest to newest. Checkpoints: nil, + // AssumeValid is the hash of a block that has been externally verified + // to be valid. + // + // Not set for simnet test network since its chain is dynamic. + AssumeValid: chainhash.Hash{}, + // MinKnownChainWork is the minimum amount of known total work for the // chain at a given point in time. // diff --git a/chaincfg/testnetparams.go b/chaincfg/testnetparams.go index 5cdb15ba..5416c35b 100644 --- a/chaincfg/testnetparams.go +++ b/chaincfg/testnetparams.go @@ -111,6 +111,16 @@ func TestNet3Params() *Params { {803810, newHashFromStr("000000016e841f4d94c3b253bc7bdf3a13217c7f28a5935bbaec37c7752678e9")}, }, + // AssumeValid is the hash of a block that has been externally verified + // to be valid. It allows several validation checks to be skipped for + // blocks that are both an ancestor of the assumed valid block and an + // ancestor of the best header. This is intended to be updated + // periodically with new releases. + // + // Block 00000000d64ceb1a686315ed56235e9a6838e3a22e9ec9bd92c2e04c09e0778b + // Height: 807905 + AssumeValid: *newHashFromStr("00000000d64ceb1a686315ed56235e9a6838e3a22e9ec9bd92c2e04c09e0778b"), + // MinKnownChainWork is the minimum amount of known total work for the // chain at a given point in time. This is intended to be updated // periodically with new releases.