Skip to content

Commit

Permalink
fix: set chain params when parsing address (generatetoaddress)
Browse files Browse the repository at this point in the history
  • Loading branch information
linden committed Nov 19, 2024
1 parent 0fcdd9f commit 1c6f7de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
"github.com/btcsuite/btcd/database"
"github.com/btcsuite/btcd/internal/config"
"github.com/btcsuite/btcd/internal/log"
"github.com/btcsuite/btcd/internal/params"
"github.com/btcsuite/btcd/mempool"
"github.com/btcsuite/btcd/mining"
"github.com/btcsuite/btcd/mining/cpuminer"
Expand Down Expand Up @@ -945,7 +946,7 @@ func generate(s *rpcServer, blocks uint32) ([]string, error) {
func handleGenerateToAddress(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
c := cmd.(*btcjson.GenerateToAddressCmd)

addr, err := btcutil.DecodeAddress(c.Address, nil)
addr, err := btcutil.DecodeAddress(c.Address, params.ActiveNetParams.Params)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 1c6f7de

Please sign in to comment.