Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addrv2 BIP155 support #101

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
I2P port is zero
The I2P protocol SAM v3.1 which is supported by bitcoin core does not use ports
hence its value is zero.

Read more at https://github.com/bitcoin/bitcoin/blob/master/doc/i2p.md#ports-in-i2p-and-bitcoin-core
  • Loading branch information
siltribera committed Sep 4, 2022
commit 04b8ff9d98b4b179f7cb0ad90dceb3f9d8cfde10
3 changes: 2 additions & 1 deletion db.h
Original file line number Diff line number Diff line change
@@ -101,7 +101,8 @@ class CAddrInfo {
}

bool IsGood() const {
if (ip.GetPort() != GetDefaultPort()) return false;
if (ip.GetPort() != GetDefaultPort() && !ip.IsI2P())
return false;
if (!(services & NODE_NETWORK)) return false;
if (!ip.IsRoutable()) return false;
if (clientVersion && clientVersion < REQUIRE_VERSION) return false;
2 changes: 1 addition & 1 deletion netbase.cpp
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ void SplitHostPort(std::string in, int &portOut, std::string &hostOut) {
int n = strtol(in.c_str() + colon + 1, &endp, 10);
if (endp && *endp == 0 && n >= 0) {
in = in.substr(0, colon);
if (n > 0 && n < 0x10000)
if (n >= 0 && n < 0x10000)
portOut = n;
}
}