Branch: refs/heads/master
Home: https://github.com/conformal/btcutil
Commit: e0ce788881952953f0f83016e2a51ae07c3f9f6b
https://github.com/conformal/btcutil/commit/e0ce788881952953f0f83016e2a51ae07c3f9f6b
Author: Dave Collins <[email protected]>
Date: 2014-02-26 (Wed, 26 Feb 2014)
Changed paths:
M address.go
M address_test.go
M internal_test.go
Log Message:
-----------
Update addresses to work with regtest network.
The prefix byte (netID) which is used to encode address is the same for
both the public test and regression test networks. Previously the code
was working under the assumption there was a 1-to-1 mapping of prefix byte
to bitcoin network, however as noted above that assumption was not
correct.
This commit modifies things a bit to choose the prefix byte at address
creation time instead of at encode time and internally stores the prefix
byte instead of the network. It also adds a new function, IsForNet, to the
Address interface which allows callers to test if an address is valid for
the passed network type. The end result of this change is that callers
will only need to change their checks from testing if addr.Net() is the
active bitcoin network to instead using addr.IsForNet(activeNet).
Closes #2.