Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with 'Version' field in RPC #83

Open
ghost opened this issue Jan 2, 2019 · 0 comments
Open

Problem with 'Version' field in RPC #83

ghost opened this issue Jan 2, 2019 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 2, 2019

./anon-cli getblock 0000003a94bed75b2aed697c8854785d7527d459c9ac0428bfbe2f23561fc11d

results in :

{ "hash": "0000003a94bed75b2aed697c8854785d7527d459c9ac0428bfbe2f23561fc11d", "confirmations": 1, "size": 3539, "height": 33131, "version": 536870912, "merkleroot": "ed9e374454ff5765b12bf100eb228b35d4d38674c0b7a69fefd5de59357656e5", "tx": [ "2af77275bef8fecd01eaa609771d936db13075f5de73d554935958a14f1d1660", "1f69fbc0a0ce6c1db55904071b18e9462f0d73ba899babab3f6dc706990642a4", "4f1d5a67c4fe66860a47345bb8f92afdcc172e118450c02b6334575c3294b147" ], "time": 1546269552, "nonce": "02e59cf5000000030000000000000000770b0168000000000000000068010b76", "solution": "0da7257c5137475e1f169804e7e497a58f832f8a7ed1cb62a9142739afc8b0f6e673fcbcd973c4bb075a361d11c2e7ec2a63258ba118aa954edd1b3ac3749296d92b787add688f82b97dd535ccd028396e2a436d9a251b16277dd4f0addb8f2763fcfdeb", "bits": "1d48030b", "difficulty": 59641567.01038337, "chainwork": "0000000000000000000000000000000000000000000000000000012823f68303", "anchor": "c6222012cf451310fa338e50379238f9113743e1147a9b74b56523cbdf1bfbf9", "previousblockhash": "0000000ed0ecee43d14abf2fa30e576b17bc7cff16bf6f69a74fe759ee4cd547" }

Get the hex version from RPC;

./anon-cli getblock 0000003a94bed75b2aed697c8854785d7527d459c9ac0428bfbe2f23561fc11d false 0000002047d54cee59e74fa7696fbf16ff7cbc176b570ea32fbf4ad143eeecd00e000000e556763559ded5ef9fa6b7c07486d3d4358b22eb00f12bb16557ff5444379eed000000000000000000000000000000000000000000000000000000000000000070332a5c0b03481d760b0168000000000000000068010b77000000000000000003000000f59ce502640da7257c5137475e1f169804e7e497a58f832f8a7ed1cb62a9142739afc8b0f6e673fcbcd973c4bb075a361d11c2e7ec2a63258ba118aa954edd1b3ac3749296d92b787add688f82b97dd535ccd028396e2a436d9a251b16277dd4f0addb8f2763fcfdeb0301000000010000000000000000000000000000000000000000000000000000000000

take the first 4 bytes (00000020) - Reverse the bytes to get the right endian format (20000000) and convert to decimal : 536870912

Same as the JSON

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants