Skip to content

Commit 67a81ad

Browse files
committed
keystore+waddrmgr: use regtest related settings
In this commit, we add checks to set the right settings when the user is on regtest.
1 parent 129f0fc commit 67a81ad

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/legacy/keystore/keystore.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ func (net *netParams) ReadFrom(r io.Reader) (int64, error) {
494494
*net = (netParams)(chaincfg.TestNet3Params)
495495
case wire.SimNet:
496496
*net = (netParams)(chaincfg.SimNetParams)
497+
case wire.TestNet:
498+
*net = (netParams)(chaincfg.RegressionNetParams)
497499

498500
// The legacy key store won't be compatible with custom signets, only
499501
// the main public one.

waddrmgr/migrations.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ func populateBirthdayBlock(ns walletdb.ReadWriteBucket) error {
326326
genesisTimestamp =
327327
chaincfg.SigNetParams.GenesisBlock.Header.Timestamp
328328

329+
case *chaincfg.RegressionNetParams.GenesisHash:
330+
genesisTimestamp =
331+
chaincfg.RegressionNetParams.GenesisBlock.Header.Timestamp
332+
329333
default:
330334
return fmt.Errorf("unknown genesis hash %v", genesisHash)
331335
}

0 commit comments

Comments
 (0)