diff options
| author | Cory Fields <[email protected]> | 2016-04-17 20:21:58 -0400 |
|---|---|---|
| committer | Cory Fields <[email protected]> | 2016-09-08 12:24:06 -0400 |
| commit | 960cf2e4058a9c195bf64e1aecb46024f9ef022a (patch) | |
| tree | 4f1400221f79419d8942fe48961c4ef24886c0e3 /src/main.cpp | |
| parent | net: move nLastNodeId to CConnman (diff) | |
| download | discoin-960cf2e4058a9c195bf64e1aecb46024f9ef022a.tar.xz discoin-960cf2e4058a9c195bf64e1aecb46024f9ef022a.zip | |
net: move nLocalHostNonce to CConnman
This behavior seems to have been quite racy and broken.
Move nLocalHostNonce into CNode, and check received nonces against all
non-fully-connected nodes. If there's a match, assume we've connected
to ourself.
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp index af598d487..43ccb6374 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5025,7 +5025,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } // Disconnect if we connected to ourself - if (nNonce == nLocalHostNonce && nNonce > 1) + if (pfrom->fInbound && !connman.CheckIncomingNonce(nNonce)) { LogPrintf("connected to self at %s, disconnecting\n", pfrom->addr.ToString()); pfrom->fDisconnect = true; |