aboutsummaryrefslogtreecommitdiff
path: root/src/crypto
diff options
context:
space:
mode:
authorVasil Dimov <vd@FreeBSD.org>2020-08-27 11:03:21 +0200
committerVasil Dimov <vd@FreeBSD.org>2020-09-21 10:13:34 +0200
commit7be6ff61875a8d5d2335bff5d1f16ba40557adb0 (patch)
treea2c60b8c3ad2144f697f334c05b6f6a508743459 /src/crypto
parente0d73573a37bf4b519f6f61e5678572d48a64517 (diff)
downloadbitcoin-7be6ff61875a8d5d2335bff5d1f16ba40557adb0.tar.xz
net: recognize TORv3/I2P/CJDNS networks
Recognizing addresses from those networks allows us to accept and gossip them, even though we don't know how to connect to them (yet). Co-authored-by: eriknylund <erik@daychanged.com>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/common.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/crypto/common.h b/src/crypto/common.h
index 5b4932c992..c1acf8b22e 100644
--- a/src/crypto/common.h
+++ b/src/crypto/common.h
@@ -53,6 +53,13 @@ void static inline WriteLE64(unsigned char* ptr, uint64_t x)
memcpy(ptr, (char*)&v, 8);
}
+uint16_t static inline ReadBE16(const unsigned char* ptr)
+{
+ uint16_t x;
+ memcpy((char*)&x, ptr, 2);
+ return be16toh(x);
+}
+
uint32_t static inline ReadBE32(const unsigned char* ptr)
{
uint32_t x;