Bitcoin Forum
December 09, 2016, 04:19:33 AM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Tiny error in shy version message code  (Read 805 times)
realnowhereman
Hero Member
*****
Offline Offline

Activity: 504



View Profile
May 25, 2011, 12:34:00 PM
 #1

Code:
0c97aa9e141f5:main.cpp:2388

        // Be shy and don't send version until we hear
        if (pfrom->fInbound)
            pfrom->PushVersion();

Shouldn't this be !pfrom->fInbound ?

Outbound connections should speak first, but this code makes inbound connections speak first.

I admit I don't really know what's going on since the following is present too:

Code:
0c97aa9e141f5:net.h:567

        // Be shy and don't send version until we hear
        if (!fInbound)
            PushVersion();

Which looks more correct to me.

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
1481257173
Hero Member
*
Offline Offline

Posts: 1481257173

View Profile Personal Message (Offline)

Ignore
1481257173
Reply with quote  #2

1481257173
Report to moderator
1481257173
Hero Member
*
Offline Offline

Posts: 1481257173

View Profile Personal Message (Offline)

Ignore
1481257173
Reply with quote  #2

1481257173
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481257173
Hero Member
*
Offline Offline

Posts: 1481257173

View Profile Personal Message (Offline)

Ignore
1481257173
Reply with quote  #2

1481257173
Report to moderator
1481257173
Hero Member
*
Offline Offline

Posts: 1481257173

View Profile Personal Message (Offline)

Ignore
1481257173
Reply with quote  #2

1481257173
Report to moderator
1481257173
Hero Member
*
Offline Offline

Posts: 1481257173

View Profile Personal Message (Offline)

Ignore
1481257173
Reply with quote  #2

1481257173
Report to moderator
Hal
VIP
Sr. Member
*
expert
Offline Offline

Activity: 314



View Profile
May 25, 2011, 08:19:14 PM
 #2

I'm the author of this code. The main.cpp code sends a version message in response to receiving one, on inbound connections.

Hal Finney
realnowhereman
Hero Member
*****
Offline Offline

Activity: 504



View Profile
May 26, 2011, 06:12:54 AM
 #3

Of course.  Feeling dim now.

1AAZ4xBHbiCr96nsZJ8jtPkSzsg1CqhwDa
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!