chainparams: ensure target chain checkpoints are properly set

This commit is contained in:
Olaoluwa Osuntokun 2017-09-01 03:17:19 -07:00
parent 5296df5d4d
commit 42743efa76
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -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
}