0

I've been playing around with geth for a private chain implementation where we're using a much larger circulation of ether on our chain.

To modify this I tried changing the block reward to:

*big.Int = big.NewInt(25000e+18) in ethash/consensus.go

But, this lead to the error that the Int is overflowing as it seems golang automatically casts big.NewInt as an Int64 type.

Given that on the current Ethereum blockchain users have balances greater than an Int64 number would allow (when denoted in Wei) I assume that there is a work around implemented for geth that hasn't been applied to the block reward logic.

Is anyone familiar with how this is handled and how I might be able to adjust the blockreward to a number greater than an Int64 would allow?

1 Answer 1

1

Turns out that under the hood big.Int can handle numbers greater than Int64 type and return them, but can't set them straight out.

To solve, you set the initial number as a big.Int such as (25000) and the apply .Mul for the (1e+18) which will store the value equivalent (25000e+18)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.