Browse Source

Start to tweak hush_supply and save old script to compare results

hip39
Duke Leto 4 years ago
parent
commit
9deb58fa4e
  1. 2
      contrib/hush_supply
  2. 33
      contrib/hush_supply_old

2
contrib/hush_supply

@ -1,5 +1,5 @@
#!/usr/bin/env perl
# Copyright 2019 The Hush developers
# Copyright 2019-2020 The Hush developers
# Released under the GPLv3
use warnings;
use strict;

33
contrib/hush_supply_old

@ -0,0 +1,33 @@
#!/usr/bin/env perl
# Copyright 2019-2020 The Hush developers
# Released under the GPLv3
use warnings;
use strict;
my $supply = 0.0;
my $block = 0;
my $satoshis = 100_000_000;
my $amount = int(12.5*$satoshis);
my $halvings = 0;
# Usage: ./hush_supply &> supply.csv
# Use this to calculate when supply hits a certain value
#while ($supply <= 21_000_000*$satoshis) {
# Use this to calculate when block rewards end
while ($halvings <= 64 && $amount >= 1) {
$block++;
if ($block < 5) {
$amount = 40_000 * $satoshis;
} else {
# Halving every 840000 blocks
if ($block % 840_000 == 0) {
$amount /= 2;
$halvings++;
}
$amount = int(12.5*$satoshis) / (2**$halvings);
}
$supply += $amount;
# block, current supply, block reward amount, number of halvings
printf "%s,%s,%s,%s\n", $block,$supply / $satoshis, $amount / $satoshis, $halvings;
}
Loading…
Cancel
Save