From 6d4ee7e0329491c51e4198ba2b6f7dae175a42c1 Mon Sep 17 00:00:00 2001 From: yuriy0803 <68668177+yuriy0803@users.noreply.github.com> Date: Sat, 10 Jun 2023 23:01:20 +0200 Subject: [PATCH] UncleRewardExpanse --- payouts/unlocker.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/payouts/unlocker.go b/payouts/unlocker.go index 3793edb..3e7e9e9 100644 --- a/payouts/unlocker.go +++ b/payouts/unlocker.go @@ -383,7 +383,7 @@ func handleUncle(height int64, uncle *rpc.GetBlockReply, candidate *storage.Bloc } else if cfg.Network == "ubiq" { reward = getUncleRewardUbiq(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardUbiq(height)) } else if cfg.Network == "expanse" { - reward = getUncleRewardUbiq(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardExpanse(height)) + reward = getUncleRewardExpanse(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardExpanse(height)) } else if cfg.Network == "etica" { reward = getUncleRewardEthereum(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardetica(height)) } else if cfg.Network == "callisto" { @@ -746,6 +746,17 @@ func getConstRewardExpanse(height int64) *big.Int { return new(big.Int).Set(homesteadExpanseReward) } +// expanse Uncle rw +func getUncleRewardExpanse(uHeight *big.Int, height *big.Int, reward *big.Int) *big.Int { + r := new(big.Int) + r.Add(uHeight, big8) + r.Sub(r, height) + r.Mul(r, reward) + r.Div(r, big8) + + return r +} + func getConstRewardEthereumpow(height int64) *big.Int { // Rewards) // EthereumPow