Bitcoin Forum
August 21, 2018, 02:55:40 PM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Is this correct code to sending work to Bitcoin server?  (Read 437 times)
Taro Kudo
Offline Offline

Activity: 6
Merit: 0

View Profile
September 11, 2011, 07:36:41 AM

Hi I am writing Bitcoin miner with Java for studying bitcoin technology.
But I am not sure this code is correct.
The code is to make getwork() sending data to RPC interface of bitcoind.

String num16 = Integer.toHexString(foundNonce);
String zero="";
for(int zi=0;zi<8-num16.length();zi++){
String senddata = originalData.substring(0,152) + zero + num16 + originalData.substring(160);

  • senddata is a string to send to bitcoind
  • foundNonce is a integer value of founded nonce
  • originalData is a data from bitcoind getwork() method

Thank you for your help.
Pages: [1]
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!