0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-05 10:17:30 -05:00
bitcoin-bitcoin-core/src/util
Pieter Wuille 655937ebcb
Merge #19845: net: CNetAddr: add support to (un)serialize as ADDRv2
7be6ff6187 net: recognize TORv3/I2P/CJDNS networks (Vasil Dimov)
e0d73573a3 net: CNetAddr: add support to (un)serialize as ADDRv2 (Vasil Dimov)
fe42411b4b test: move HasReason so it can be reused (Vasil Dimov)
d2bb681f96 util: move HasPrefix() so it can be reused (Vasil Dimov)

Pull request description:

  (chopped off from #19031 to ease review)

  Add an optional support to serialize/unserialize `CNetAddr` in ADDRv2 format (BIP155). The new serialization is engaged by ORing a flag into the stream version.

  So far this is only used in tests to ensure the new code works as expected.

ACKs for top commit:
  Sjors:
    re-tACK 7be6ff6187
  sipa:
    re-utACK 7be6ff6187
  eriknylund:
    ACK 7be6ff6187 I built the PR on macOS Catalina 10.15.6, ran both tests and functional tests. I've reviewed the code and think the changes look good and according to BIP155. I verified that the added Base32 encoding test looks as proposed and working. I've run a node for a week only with Onion addresses `-onlynet=onion` without issues and I can connect to other peer reviewers running TorV3 on their nodes and I can connect both of my test nodes to each other.
  jonatack:
    re-ACK 7be6ff6187 per `git diff b9c46e0 7be6ff6`, debug build, ran/running bitcoind with this change and observed the log and `-netinfo` peer connections while connected as a tor v2 service to both tor v2 peers and also five tor v3 peers.
  hebasto:
    ACK 7be6ff6187, tested on Linux Mint 20 (x86_64): on top of this pull and #19031 I'm able to connect to onion v3 addresses, and jonatack is able to connect to my created onion v3 address.

Tree-SHA512: dc621411ac4393993aa3ccad10991717ec5f9f2643cae46a24a89802df0a33d6042994fc8ff2f0f397a3dbcd1c0e58fe4724305a2f9eb64d9342c3bdf784d9be
2020-09-28 12:27:08 -07:00
..
asmap.cpp refactor: Rework asmap Interpret to avoid ptrdiff_t 2020-05-09 00:20:00 -07:00
asmap.h Add asmap sanity checker 2020-04-08 16:26:06 -07:00
bip32.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
bip32.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
bytevectorhash.cpp blockfilter: Use unordered_set instead of set in blockfilter. 2018-11-05 09:30:56 -08:00
bytevectorhash.h blockfilter: Use unordered_set instead of set in blockfilter. 2018-11-05 09:30:56 -08:00
check.h util: Make Assert work with any value 2020-07-11 15:02:07 +02:00
error.cpp Improve TransactionErrorString messages. 2020-06-18 23:32:59 -07:00
error.h refactor: Error message bilingual_str consistency 2020-06-09 15:39:44 +02:00
fees.cpp rpc/wallet: add two explicit modes to estimate_mode 2020-06-24 16:01:37 +09:00
fees.h fees: add FeeModes doc helper function 2020-06-24 15:52:05 +09:00
golombrice.h tests: Add fuzzing harness for Golomb-Rice coding (GolombRiceEncode/GolombRiceDecode) 2020-04-20 14:57:48 +00:00
macros.h refactor: consolidate PASTE macros 2019-09-25 10:56:00 -04:00
memory.h scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
message.cpp util: make EncodeBase64 consume Spans 2020-08-25 18:52:57 +02:00
message.h Move direct calls to MessageSign into new SignMessage functions in CWallet and ScriptPubKeyMan 2020-03-09 11:16:20 -04:00
moneystr.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
moneystr.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
rbf.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
rbf.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
ref.h Add util::Ref class as temporary alternative for c++17 std::any 2020-05-13 16:20:13 -04:00
settings.cpp Add <datadir>/settings.json persistent settings storage. 2020-07-11 05:41:12 -04:00
settings.h Add <datadir>/settings.json persistent settings storage. 2020-07-11 05:41:12 -04:00
spanparsing.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
spanparsing.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
strencodings.cpp net: recognize TORv3/I2P/CJDNS networks 2020-09-21 10:13:34 +02:00
strencodings.h net: recognize TORv3/I2P/CJDNS networks 2020-09-21 10:13:34 +02:00
string.cpp util: Add Join helper to join a list of strings 2019-08-20 16:51:41 -04:00
string.h util: move HasPrefix() so it can be reused 2020-09-11 13:35:39 +02:00
system.cpp Merge #18267: BIP-325: Signet [consensus] 2020-09-21 22:33:00 +02:00
system.h [util] add RunCommandParseJSON 2020-07-31 13:38:10 +02:00
threadnames.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
threadnames.h scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
time.cpp scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
time.h util: Add count_microseconds helper 2020-06-19 07:25:35 -04:00
translation.h refactor: Fix unreachable code in init arg checks 2020-06-02 06:20:04 +10:00
ui_change_type.h wallet: Do not include server symbols 2020-06-27 11:39:09 -04:00
url.cpp scripted-diff: Bump copyright of files changed in 2019 2019-12-30 10:42:20 +13:00
url.h scripted-diff: Bump copyright headers 2020-04-16 13:33:09 -04:00
vector.h Add some general std::vector utility functions 2019-10-16 08:56:57 -07:00