Skip to content
This repository was archived by the owner on Apr 3, 2022. It is now read-only.

Commit aca1d8f

Browse files
committed
HardFork at block-6713000 to limit emission of Atlantis.
1 parent 4682128 commit aca1d8f

6 files changed

Lines changed: 15 additions & 2 deletions

File tree

blockchain/blockchain.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1216,6 +1216,11 @@ skip_checks:
12161216
// and leave the original TX untouched
12171217
total_reward := base_reward + total_fees
12181218

1219+
if hard_fork_version_current >= 5 {
1220+
total_reward = 1 // 1 atomic unit
1221+
base_reward = 0 // 0 atomic unit
1222+
}
1223+
12191224
// store total reward
12201225
dbtx.StoreUint64(BLOCKCHAIN_UNIVERSE, GALAXY_BLOCK, bl_current_hash[:], PLANET_MINERTX_REWARD, total_reward)
12211226

blockchain/hardfork_core.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ var mainnet_hard_forks = []Hard_fork{
5050
{2, 95551, 0, 0, 0, true}, // version 2 hard fork where Atlantis bootstraps , it's mandatory
5151
{3, 721000, 0, 0, 0, true}, // version 3 hard fork emission fix, it's mandatory
5252
{4, 4550555, 0, 0, 0, true}, // version 4 hard fork AstroBWT CPU Mining enabled. It's mandatory
53+
{5, config.HF5_HEIGHT, 0, 0, 0, true}, // version 5 hard fork where we keep the chain alive, so who could not swap earlier can swap later
5354
}
5455

5556
// current testnet_hard_forks
5657
var testnet_hard_forks = []Hard_fork{
5758
//{1, 0, 0, 0, 0, true}, // version 1 hard fork where genesis block landed
5859
{3, 0, 0, 0, 0, true}, // version 3 hard fork where we started , it's mandatory
5960
{4, 3, 0, 0, 0, true}, // version 4 hard fork where we change mining algorithm it's mandatory
61+
{5, 4, 0, 0, 0, true}, // version 5 hard fork where we keep the chain alive, so who could not swap earlier can swap later
6062
}
6163

6264
// current simulation_hard_forks

config/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ const MAINNET_MINIMUM_DIFFICULTY = uint64(5* 1000 * BLOCK_TIME_hf4) // 5 KH/s
9393
const TESTNET_BOOTSTRAP_DIFFICULTY = uint64(1600 * BLOCK_TIME_hf4) // testnet bootstrap at 800 H/s
9494
const TESTNET_MINIMUM_DIFFICULTY = uint64(800 * BLOCK_TIME_hf4) // 800 H
9595

96+
const HF5_HEIGHT = 6713000 // hf applies at this height
97+
9698

9799
// this single parameter controls lots of various parameters
98100
// within the consensus, it should never go below 7

config/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ import "github.com/blang/semver"
2020

2121
// right now it has to be manually changed
2222
// do we need to include git commitsha??
23-
var Version = semver.MustParse("2.2.1-0.Atlantis.Astrobwt+03072020")
23+
var Version = semver.MustParse("2.2.2-13.Atlantis.Astrobwt+11032022")

go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/deroproject/derosuite
2+
3+
go 1.17

walletapi/wallet_transfer.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,8 @@ func (w *Wallet) select_outputs_for_transfer(needed_amount uint64, fees uint64,
716716
continue
717717
}
718718

719-
if inputmaturity.Is_Input_Mature(w.Get_Height(),
719+
// do not select indexes which are past HF and which are dust
720+
if tx.TXdata.Height <= config.HF5_HEIGHT && tx.WAmount > 20 && inputmaturity.Is_Input_Mature(w.Get_Height(),
720721
tx.TXdata.Height,
721722
tx.TXdata.Unlock_Height,
722723
tx.TXdata.SigType) && !w.IsKeyImageSpent(tx.WKimage) {

0 commit comments

Comments
 (0)