multi: add testnet4 support

This commit is contained in:
Oliver Gugger
2025-03-20 11:47:18 -05:00
parent e5b9d9684a
commit 0aea482b51
13 changed files with 68 additions and 18 deletions

View File

@@ -22,6 +22,14 @@ var BitcoinTestNetParams = BitcoinNetParams{
CoinType: keychain.CoinTypeTestnet,
}
// BitcoinTestNet4Params contains parameters specific to the 4th version of the
// test network.
var BitcoinTestNet4Params = BitcoinNetParams{
Params: &bitcoinCfg.TestNet4Params,
RPCPort: "48334",
CoinType: keychain.CoinTypeTestnet,
}
// BitcoinMainNetParams contains parameters specific to the current Bitcoin
// mainnet.
var BitcoinMainNetParams = BitcoinNetParams{
@@ -53,8 +61,9 @@ var BitcoinRegTestNetParams = BitcoinNetParams{
CoinType: keychain.CoinTypeTestnet,
}
// IsTestnet tests if the givern params correspond to a testnet
// parameter configuration.
// IsTestnet tests if the given params correspond to a testnet parameter
// configuration.
func IsTestnet(params *BitcoinNetParams) bool {
return params.Params.Net == bitcoinWire.TestNet3
return params.Params.Net == bitcoinWire.TestNet3 ||
params.Params.Net == bitcoinWire.TestNet4
}

View File

@@ -838,6 +838,15 @@ var (
0x01, 0xea, 0x33, 0x09, 0x00, 0x00, 0x00, 0x00,
})
// BitcoinTestnet4Genesis is the genesis hash of Bitcoin's testnet4
// chain.
BitcoinTestnet4Genesis = chainhash.Hash([chainhash.HashSize]byte{
0x43, 0xf0, 0x8b, 0xda, 0xb0, 0x50, 0xe3, 0x5b,
0x56, 0x7c, 0x86, 0x4b, 0x91, 0xf4, 0x7f, 0x50,
0xae, 0x72, 0x5a, 0xe2, 0xde, 0x53, 0xbc, 0xfb,
0xba, 0xf2, 0x84, 0xda, 0x00, 0x00, 0x00, 0x00,
})
// BitcoinSignetGenesis is the genesis hash of Bitcoin's signet chain.
BitcoinSignetGenesis = chainhash.Hash([chainhash.HashSize]byte{
0xf6, 0x1e, 0xee, 0x3b, 0x63, 0xa3, 0x80, 0xa4,