chainparams: ensure target chain checkpoints are properly set
This commit is contained in:
parent
5296df5d4d
commit
42743efa76
@ -2,7 +2,9 @@ package main
|
||||
|
||||
import (
|
||||
litecoinCfg "github.com/ltcsuite/ltcd/chaincfg"
|
||||
"github.com/roasbeef/btcd/chaincfg"
|
||||
bitcoinCfg "github.com/roasbeef/btcd/chaincfg"
|
||||
"github.com/roasbeef/btcd/chaincfg/chainhash"
|
||||
"github.com/roasbeef/btcd/wire"
|
||||
)
|
||||
|
||||
@ -76,5 +78,17 @@ func applyLitecoinParams(params *bitcoinNetParams) {
|
||||
|
||||
params.HDCoinType = liteTestNetParams.HDCoinType
|
||||
|
||||
checkPoints := make([]chaincfg.Checkpoint, len(liteTestNetParams.Checkpoints))
|
||||
for i := 0; i < len(liteTestNetParams.Checkpoints); i++ {
|
||||
var chainHash chainhash.Hash
|
||||
copy(chainHash[:], liteTestNetParams.Checkpoints[i].Hash[:])
|
||||
|
||||
checkPoints[i] = chaincfg.Checkpoint{
|
||||
Height: liteTestNetParams.Checkpoints[i].Height,
|
||||
Hash: &chainHash,
|
||||
}
|
||||
}
|
||||
params.Checkpoints = checkPoints
|
||||
|
||||
params.rpcPort = liteTestNetParams.rpcPort
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user