Verify that addresses are intended for the active net. #457

Merged
merged 2 commits into from Dec 16, 2016

Projects

None yet

3 participants

@jrick
Member
jrick commented Dec 15, 2016

Fixes #456.

@dajohi
dajohi approved these changes Dec 16, 2016 View changes

OK

rpc/rpcserver/server.go
+func decodeAddress(a string, params *chaincfg.Params) (dcrutil.Address, error) {
+ addr, err := dcrutil.DecodeAddress(a, params)
+ if err != nil {
+ return nil, grpc.Errorf(codes.InvalidArgument, "invalid address %v", a)
@dajohi
dajohi Dec 16, 2016 Member

is it worth printing the err?

@jrick
jrick Dec 16, 2016 Member

could be

@alexlyp

OK

@jrick jrick merged commit feab1cc into decred:master Dec 16, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jrick jrick deleted the jrick:checkaddrnet branch Dec 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment