Skip to content

Commit

Permalink
keystore+waddrmgr: use regtest related settings
Browse files Browse the repository at this point in the history
In this commit, we add checks to set the right settings when the
user is on regtest.
  • Loading branch information
Abdulkbk committed Feb 11, 2025
1 parent 64e271c commit fe97fbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/legacy/keystore/keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,8 @@ func (net *netParams) ReadFrom(r io.Reader) (int64, error) {
*net = (netParams)(chaincfg.TestNet3Params)
case wire.SimNet:
*net = (netParams)(chaincfg.SimNetParams)
case wire.TestNet:
*net = (netParams)(chaincfg.RegressionNetParams)

// The legacy key store won't be compatible with custom signets, only
// the main public one.
Expand Down
4 changes: 4 additions & 0 deletions waddrmgr/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ func populateBirthdayBlock(ns walletdb.ReadWriteBucket) error {
genesisTimestamp =
chaincfg.SigNetParams.GenesisBlock.Header.Timestamp

case *chaincfg.RegressionNetParams.GenesisHash:
genesisTimestamp =
chaincfg.RegressionNetParams.GenesisBlock.Header.Timestamp

default:
return fmt.Errorf("unknown genesis hash %v", genesisHash)
}
Expand Down

0 comments on commit fe97fbe

Please sign in to comment.