diff options
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 19 |
1 files changed, 0 insertions, 19 deletions
| @@ -29,21 +29,6 @@ CNode* ConnectNodeBtfResolved(const string& strBtfAddr, const string& strMeeting | |||
| 29 | void ThreadBtfAccept(void* parg); | 29 | void ThreadBtfAccept(void* parg); |
| 30 | void ThreadBtfConnect(void* parg); | 30 | void ThreadBtfConnect(void* parg); |
| 31 | extern string strBtfConnect; | 31 | extern string strBtfConnect; |
| 32 | |||
| 33 | // --- .btf peer exchange --------------------------------------------------- | ||
| 34 | // Peers gossip signed descriptors so discovery survives a relay outage. Both | ||
| 35 | // caps apply to a single "btfpeers" message; the generic header limit is 256 MB, | ||
| 36 | // which is no protection at all for something a stranger can send unprompted. | ||
| 37 | static const unsigned int MAX_PEX_DESCRIPTORS = 20; | ||
| 38 | static const unsigned int MAX_PEX_DESCRIPTOR_BYTES = 1024; | ||
| 39 | // Ignore a peer's exchange more often than this. One announcement per side per | ||
| 40 | // connection is the intended traffic; anything faster is someone else's idea. | ||
| 41 | static const int64 PEX_MIN_INTERVAL = 60; | ||
| 42 | |||
| 43 | // Descriptors to hand a peer: ours first, then peers that answered us. | ||
| 44 | void BtfPexCollect(std::vector<std::string>& vDescOut); | ||
| 45 | // Verify descriptors a peer sent and remember the good ones. Returns how many. | ||
| 46 | int BtfPexAccept(const std::vector<std::string>& vDesc); | ||
| 47 | void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1); | 32 | void AbandonRequests(void (*fn)(void*, CDataStream&), void* param1); |
| 48 | bool AnySubscribed(unsigned int nChannel); | 33 | bool AnySubscribed(unsigned int nChannel); |
| 49 | void ThreadBitcoinMiner(void* parg); | 34 | void ThreadBitcoinMiner(void* parg); |
| @@ -482,9 +467,6 @@ public: | |||
| 482 | // publish and subscription | 467 | // publish and subscription |
| 483 | vector<char> vfSubscribe; | 468 | vector<char> vfSubscribe; |
| 484 | 469 | ||
| 485 | // Last "btfpeers" we accepted from this node, to rate-limit the exchange. | ||
| 486 | int64 nLastPexRecv; | ||
| 487 | |||
| 488 | 470 | ||
| 489 | CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false) | 471 | CNode(SOCKET hSocketIn, CAddress addrIn, bool fInboundIn=false) |
| 490 | { | 472 | { |
| @@ -501,7 +483,6 @@ public: | |||
| 501 | fDisconnect = false; | 483 | fDisconnect = false; |
| 502 | nRefCount = 0; | 484 | nRefCount = 0; |
| 503 | nReleaseTime = 0; | 485 | nReleaseTime = 0; |
| 504 | nLastPexRecv = 0; | ||
| 505 | vfSubscribe.assign(256, false); | 486 | vfSubscribe.assign(256, false); |
| 506 | 487 | ||
| 507 | // Push a version message | 488 | // Push a version message |