chains: specify that current btc+ltc genesis hashes are for testnet

This commit is contained in:
Olaoluwa Osuntokun 2018-03-14 17:03:22 -07:00
parent 695b09e32b
commit 0cd2448f49
1 changed files with 10 additions and 8 deletions

View File

@ -560,16 +560,18 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
} }
var ( var (
// bitcoinGenesis is the genesis hash of Bitcoin's testnet chain. // bitcoinTestnetGenesis is the genesis hash of Bitcoin's testnet
bitcoinGenesis = chainhash.Hash([chainhash.HashSize]byte{ // chain.
bitcoinTestnetGenesis = chainhash.Hash([chainhash.HashSize]byte{
0x43, 0x49, 0x7f, 0xd7, 0xf8, 0x26, 0x95, 0x71, 0x43, 0x49, 0x7f, 0xd7, 0xf8, 0x26, 0x95, 0x71,
0x08, 0xf4, 0xa3, 0x0f, 0xd9, 0xce, 0xc3, 0xae, 0x08, 0xf4, 0xa3, 0x0f, 0xd9, 0xce, 0xc3, 0xae,
0xba, 0x79, 0x97, 0x20, 0x84, 0xe9, 0x0e, 0xad, 0xba, 0x79, 0x97, 0x20, 0x84, 0xe9, 0x0e, 0xad,
0x01, 0xea, 0x33, 0x09, 0x00, 0x00, 0x00, 0x00, 0x01, 0xea, 0x33, 0x09, 0x00, 0x00, 0x00, 0x00,
}) })
// litecoinGenesis is the genesis hash of Litecoin's testnet4 chain. // litecoinTestnetGenesis is the genesis hash of Litecoin's testnet4
litecoinGenesis = chainhash.Hash([chainhash.HashSize]byte{ // chain.
litecoinTestnetGenesis = chainhash.Hash([chainhash.HashSize]byte{
0xa0, 0x29, 0x3e, 0x4e, 0xeb, 0x3d, 0xa6, 0xe6, 0xa0, 0x29, 0x3e, 0x4e, 0xeb, 0x3d, 0xa6, 0xe6,
0xf5, 0x6f, 0x81, 0xed, 0x59, 0x5f, 0x57, 0x88, 0xf5, 0x6f, 0x81, 0xed, 0x59, 0x5f, 0x57, 0x88,
0x0d, 0x1a, 0x21, 0x56, 0x9e, 0x13, 0xee, 0xfd, 0x0d, 0x1a, 0x21, 0x56, 0x9e, 0x13, 0xee, 0xfd,
@ -579,15 +581,15 @@ var (
// chainMap is a simple index that maps a chain's genesis hash to the // chainMap is a simple index that maps a chain's genesis hash to the
// chainCode enum for that chain. // chainCode enum for that chain.
chainMap = map[chainhash.Hash]chainCode{ chainMap = map[chainhash.Hash]chainCode{
bitcoinGenesis: bitcoinChain, bitcoinTestnetGenesis: bitcoinChain,
litecoinGenesis: litecoinChain, litecoinTestnetGenesis: litecoinChain,
} }
// reverseChainMap is the inverse of the chainMap above: it maps the // reverseChainMap is the inverse of the chainMap above: it maps the
// chain enum for a chain to its genesis hash. // chain enum for a chain to its genesis hash.
reverseChainMap = map[chainCode]chainhash.Hash{ reverseChainMap = map[chainCode]chainhash.Hash{
bitcoinChain: bitcoinGenesis, bitcoinChain: bitcoinTestnetGenesis,
litecoinChain: litecoinGenesis, litecoinChain: litecoinTestnetGenesis,
} }
// chainDNSSeeds is a map of a chain's hash to the set of DNS seeds // chainDNSSeeds is a map of a chain's hash to the set of DNS seeds