Skip to content

Commit

Permalink
manually output block 0, to get around bug in bitcoind getblockstats
Browse files Browse the repository at this point in the history
  • Loading branch information
flipper committed Jul 11, 2021
1 parent 6e37389 commit ba68797
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
15 changes: 15 additions & 0 deletions datafetch/getblockbits.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# have to output block 0 manually because of bug in bitcoind
# https://github.com/bitcoin/bitcoin/issues/19885

# height
echo 0
# hash
echo '"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"'
# bits
echo '"1d00ffff"'
# difficulty
echo 1
# chainwork
echo '"0000000000000000000000000000000000000000000000000000000100010001"'


for HEIGHT in {1..649616}
do
HASH=`bitcoin-cli getblockstats $HEIGHT | jq --monochrome-output '.["blockhash"]' | cut -b2-65`
Expand Down
17 changes: 17 additions & 0 deletions datafetch/getblockstats.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# have to output block 0 manually because of bug in bitcoind
# https://github.com/bitcoin/bitcoin/issues/19885

# height
echo 0
# hash
echo '"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"'
# subsidy
echo 5000000000
# totalfee
echo 0
# time
echo 1231006505
# mediantime
echo 1231006505


for HEIGHT in {1..649616}
do
bitcoin-cli getblockstats $HEIGHT | jq --monochrome-output '.["height","blockhash","subsidy","totalfee","time","mediantime"]'
Expand Down

0 comments on commit ba68797

Please sign in to comment.