Bitcoin Forum

Other => Beginners & Help => Topic started by: mustyoshi on April 15, 2013, 05:39:07 PM



Title: CBitcoinAddress, Endianness, and Addresses.
Post by: mustyoshi on April 15, 2013, 05:39:07 PM
So I'm just messing around with the Satoshi client, and this
Code:
    CBitcoinAddress myAddr = CBitcoinAddress("19t98d9GwycvrUYos8cf9k7HSUXyMFyo2z");
    CKeyID myKey;
    myAddr.GetKeyID(myKey);
    fprintf(stdout,"Key1:%s\n",myKey.GetHex().c_str());
This outputs the correct RipeMD160 that I would expect, EXCEPT it's completely reversed to what blockchain.info gives me. I'm just wondering if I use this code
Code:
CTxDestination myDest = myAddr.Get();
...
CWalletTx myTx
pwalletMain->SendMoneyToDestination(myDest,100000,myTx,true);
Will that send the bitcoins to the correct address? Is endianness all taken care of by the client?
I just want to ask somebody else's opinion before I start using this so I don't lose my coins.


Title: Re: CBitcoinAddress, Endianness, and Addresses.
Post by: wumpus on April 15, 2013, 06:52:58 PM
Yes, that is correct. The values on blockchain are reversed.


Title: Re: CBitcoinAddress, Endianness, and Addresses.
Post by: mustyoshi on April 15, 2013, 07:21:40 PM
Thanks.