2

I have recently been digging into go-ethereum and have 'plugged' my own consensus mechanism which requires a node to solve a simple equation (2+2) etc to seal a block. enter image description here

However, even after letting it run to 4392 blocks the miner address still has not received any eth?

enter image description here

Can someone point me in the right direction such as documentation of where the reward is given in the codebase? I cannot seem to find it. Cheers!

2

Can someone point me in the right direction such as documentation of where the reward is given in the codebase?

The static block reward is defined in consensus.go:

FrontierBlockReward       = big.NewInt(5e+18) // Block reward in wei for successfully mining a block
ByzantiumBlockReward      = big.NewInt(3e+18) // Block reward in wei for successfully mining a block upward from Byzantium
ConstantinopleBlockReward = big.NewInt(2e+18) // Block reward in wei for successfully mining a block upward from Constantinople

Later in the same file is accumulateRewards():

// AccumulateRewards credits the coinbase of the given block with the mining
// reward. The total reward consists of the static block reward and rewards for
// included uncles. The coinbase of each uncle block is also rewarded.
  • 2
    Ah yes, I see now, I had to add ether during the finalize function using the coinbase address of that block. Cheers! – Yanzal Nov 29 '18 at 23:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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