Bitcoin Forum
May 25, 2024, 06:04:35 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: CBitcoinAddress, Endianness, and Addresses.  (Read 537 times)
mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
April 15, 2013, 05:39:07 PM
 #1

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.
wumpus
Hero Member
*****
Offline Offline

Activity: 812
Merit: 1022

No Maps for These Territories


View Profile
April 15, 2013, 06:52:58 PM
 #2

Yes, that is correct. The values on blockchain are reversed.

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.
mustyoshi (OP)
Sr. Member
****
Offline Offline

Activity: 287
Merit: 250



View Profile
April 15, 2013, 07:21:40 PM
 #3

Thanks.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!