Added blockmintxfee setting to BlockDefinitionOptions#133
Added blockmintxfee setting to BlockDefinitionOptions#133dangershony merged 4 commits intoblock-core:masterfrom
Conversation
DennisAMenace
commented
May 27, 2020
- Added RewardRequired
- Updated x42 consensus and added MinBlockFeeRate to consensus options.
Added RewardRequired Updated x42 consensus and added MinBlockFeeRate to consensus options.
| /// If the block can have no rewards. | ||
| /// </summary> | ||
| /// <returns>True - By default require a reward for new blocks</returns> | ||
| public virtual bool RewardRequired() |
There was a problem hiding this comment.
I don't think this is needed once fee is zero in options
There was a problem hiding this comment.
It still needs to be here because reward <= 0 will reject the block otherwise.
There was a problem hiding this comment.
Ah I wonder if that condition is correct if (reward <= 0)
| if (reward <= 0) | ||
| var checkPosUtxosetRule = this.consensusManager.ConsensusRules.GetRule<CheckPosUtxosetRule>(); | ||
| long reward = fees + checkPosUtxosetRule.GetProofOfStakeReward(chainTip.Height + 1); | ||
| if (reward <= 0 && checkPosUtxosetRule.RewardRequired()) |
There was a problem hiding this comment.
This is interesting, if reward is not required just set it to zero in Network settings why add a flag?
There was a problem hiding this comment.
Default is set to reward <= 0 and with x42 a block might have no rewards, and this fails, so I need the flag here.
There was a problem hiding this comment.
I can add another network consensus item similar to the blockmintxfee, is that what you are thinking here?
There was a problem hiding this comment.
If we need this then yes a network consensus is better then changing the rule.
However I am wondering if it should not be reward < 0
There was a problem hiding this comment.
yes I think we should change this condition to be reward < 0 it's left over code form stratisx I believe and it does not make sense anymore
| [BuriedDeployments.BIP66] = 0 | ||
| }; | ||
|
|
||
| var bip9Deployments = new x42BIP9Deployments |