Update for recent btcutil Addr interface changes.
This commit is contained in:
parent
8c7c1e84a3
commit
f01459c30e
1 changed files with 2 additions and 5 deletions
|
@ -539,16 +539,13 @@ func handleCreateRawTransaction(s *rpcServer, cmd btcjson.Cmd) (interface{}, err
|
||||||
// Ensure the address is one of the supported types and that
|
// Ensure the address is one of the supported types and that
|
||||||
// the network encoded with the address matches the network the
|
// the network encoded with the address matches the network the
|
||||||
// server is currently on.
|
// server is currently on.
|
||||||
net := s.server.btcnet
|
switch addr.(type) {
|
||||||
switch addr := addr.(type) {
|
|
||||||
case *btcutil.AddressPubKeyHash:
|
case *btcutil.AddressPubKeyHash:
|
||||||
net = addr.Net()
|
|
||||||
case *btcutil.AddressScriptHash:
|
case *btcutil.AddressScriptHash:
|
||||||
net = addr.Net()
|
|
||||||
default:
|
default:
|
||||||
return nil, btcjson.ErrInvalidAddressOrKey
|
return nil, btcjson.ErrInvalidAddressOrKey
|
||||||
}
|
}
|
||||||
if net != s.server.btcnet {
|
if !addr.IsForNet(s.server.btcnet) {
|
||||||
return nil, btcjson.Error{
|
return nil, btcjson.Error{
|
||||||
Code: btcjson.ErrInvalidAddressOrKey.Code,
|
Code: btcjson.ErrInvalidAddressOrKey.Code,
|
||||||
Message: fmt.Sprintf("%s: %q",
|
Message: fmt.Sprintf("%s: %q",
|
||||||
|
|
Loading…
Reference in a new issue