Bitcoin Forum
August 21, 2018, 10:19:49 PM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Version Message and addrYou / addrMe  (Read 806 times)
Martin P. Hellwig
Jr. Member
*
Offline Offline

Activity: 33
Merit: 0


View Profile
July 14, 2011, 05:33:36 PM
 #1

Hi all, I am a bit confused here:
According to the spec and main.cpp the version message should be first me and then you:
(line 2364)
        int64 nTime;
        CAddress addrMe;
        CAddress addrFrom;
        uint64 nNonce = 1;

but from what I see over the network it is more the otherway around, as net.h would suggest too:
line 743
    void PushVersion()
    {
        /// when NTP implemented, change to just nTime = GetAdjustedTime()
        int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
        CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
        CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
        RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
        PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
                    nLocalHostNonce, std::string(pszSubVer), nBestHeight);
    }

As I am not proficient in cpp, I don't really know now what is going on.
Could someone shed a bit more light on this please?

Thanks,

Martin
1534889989
Hero Member
*
Offline Offline

Posts: 1534889989

View Profile Personal Message (Offline)

Ignore
1534889989
Reply with quote  #2

1534889989
Report to moderator
1534889989
Hero Member
*
Offline Offline

Posts: 1534889989

View Profile Personal Message (Offline)

Ignore
1534889989
Reply with quote  #2

1534889989
Report to moderator
BOUNTY PORTALS
BLOG
WHERE BOUNTY MANAGEMENT
MEETS AUTOMATION
SIGNATURE CAMPAIGNS
TWITTER
FACEBOOK
MEDIA CAMPAIGNS
AND MORE!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1534889989
Hero Member
*
Offline Offline

Posts: 1534889989

View Profile Personal Message (Offline)

Ignore
1534889989
Reply with quote  #2

1534889989
Report to moderator
wumpus
Hero Member
*****
qt
Offline Offline

Activity: 812
Merit: 1000

No Maps for These Territories


View Profile
July 14, 2011, 06:05:45 PM
 #2

One sides' "me" is the other sides' "you", I guess? That explains why they're swapped on receive.

Bitcoin Core developer [PGP] Warning: For most, coin loss is a larger risk than coin theft. A disk can die any time. Regularly back up your wallet through FileBackup Wallet to an external storage or the (encrypted!) cloud. Use a separate offline wallet for storing larger amounts.
Martin P. Hellwig
Jr. Member
*
Offline Offline

Activity: 33
Merit: 0


View Profile
July 14, 2011, 11:27:11 PM
 #3

Well I thought about that one but I have to swap both of them that is incoming and outgoing to make sense.
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!