diff options
author | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-07-29 13:31:10 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@protonmail.com> | 2020-07-29 13:31:16 +0200 |
commit | a76ccb01b96424ef207762b704d81b9d2497f3d2 (patch) | |
tree | c584959ed3de5019eeef90fd9066e7a3389c6181 /src/test/dbwrapper_tests.cpp | |
parent | 2f71a1ea35667b3873197201531e7ae198ec5bf4 (diff) | |
parent | bcfebb6d5511ad4c156868bc799831ace628a225 (diff) |
Merge #19534: net: save the network type explicitly in CNetAddr
bcfebb6d5511ad4c156868bc799831ace628a225 net: save the network type explicitly in CNetAddr (Vasil Dimov)
100c64a95b518a6a19241aec4058b866a8872d9b net: document `enum Network` (Vasil Dimov)
Pull request description:
(chopped off from https://github.com/bitcoin/bitcoin/pull/19031 to ease review)
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`.
ACKs for top commit:
troygiorshev:
reACK bcfebb6d5511ad4c156868bc799831ace628a225 via `git range-diff master 64897c5 bcfebb6`
jonatack:
re-ACK bcfebb6 per `git diff 662bb25 bcfebb6`, code review, debug build/tests clean, ran bitcoind.
laanwj:
Code review ACK bcfebb6d5511ad4c156868bc799831ace628a225
Tree-SHA512: 9347e2a50feac617a994bfb46a8f77e31c236bde882e4fd4f03eea4766cd5110216f5f3d24dee91d25218bab7f8bb6e1d2d6212a44db9e34594299fd6ff7606b
Diffstat (limited to 'src/test/dbwrapper_tests.cpp')
0 files changed, 0 insertions, 0 deletions