Browse Source

UncleRewardExpanse

master
yuriy0803 3 years ago
parent
commit
6d4ee7e032
  1. 13
      payouts/unlocker.go

13
payouts/unlocker.go

@ -383,7 +383,7 @@ func handleUncle(height int64, uncle *rpc.GetBlockReply, candidate *storage.Bloc
} else if cfg.Network == "ubiq" { } else if cfg.Network == "ubiq" {
reward = getUncleRewardUbiq(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardUbiq(height)) reward = getUncleRewardUbiq(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardUbiq(height))
} else if cfg.Network == "expanse" { } 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" { } else if cfg.Network == "etica" {
reward = getUncleRewardEthereum(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardetica(height)) reward = getUncleRewardEthereum(new(big.Int).SetInt64(uncleHeight), new(big.Int).SetInt64(height), getConstRewardetica(height))
} else if cfg.Network == "callisto" { } else if cfg.Network == "callisto" {
@ -746,6 +746,17 @@ func getConstRewardExpanse(height int64) *big.Int {
return new(big.Int).Set(homesteadExpanseReward) 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 { func getConstRewardEthereumpow(height int64) *big.Int {
// Rewards) // Rewards)
// EthereumPow // EthereumPow

Loading…
Cancel
Save