aboutsummaryrefslogtreecommitdiff
path: root/src/script/script_error.cpp
diff options
context:
space:
mode:
authorVasil Dimov <[email protected]>2020-05-14 17:03:11 +0200
committerVasil Dimov <[email protected]>2020-07-27 15:13:24 +0200
commitbcfebb6d5511ad4c156868bc799831ace628a225 (patch)
tree656d24a3f34ad2b7c7dcc767942d38549d3dfdaa /src/script/script_error.cpp
parentnet: document `enum Network` (diff)
downloaddiscoin-bcfebb6d5511ad4c156868bc799831ace628a225.tar.xz
discoin-bcfebb6d5511ad4c156868bc799831ace628a225.zip
net: save the network type explicitly in CNetAddr
Before this change, we would analyze the contents of `CNetAddr::ip[16]` in order to tell which type is an address. Change this by introducing a new member `CNetAddr::m_net` that explicitly tells the type of the address. This is necessary because in BIP155 we will not be able to tell the address type by just looking at its raw representation (e.g. both TORv3 and I2P are "seemingly random" 32 bytes). As a side effect of this change we no longer need to store IPv4 addresses encoded as IPv6 addresses - we can store them in proper 4 bytes (will be done in a separate commit). Also the code gets somewhat simplified - instead of `memcmp(ip, pchIPv4, sizeof(pchIPv4)) == 0` we can use `m_net == NET_IPV4`. Co-authored-by: Carl Dong <[email protected]>
Diffstat (limited to 'src/script/script_error.cpp')
0 files changed, 0 insertions, 0 deletions