Enabling the stake validation checks the eligibility in TestBlockValidity which is called in CreateNewBock in miner.cpp when the TransactionPicker (implementation: BlockAssemblerAdapter) invokes it to gather a list of transactions to include in a block. This pseudo-block which is created does not have eligible stake (for the same reason the merkle check is skipped, already in existing bitcoin code).
This fixes that by introducig a clean flag to bypass that check (much like the previous flags which also bypassed certain checks, but using the XXXFlags from validation_flags.h instead of boolean flags - which in my mind/experience are a code smell and should be avoided).
Depends on #935
The only new commit which distinguishes this pull request from #935 is https://github.com/dtr-org/unit-e/pull/952/commits/77aa80977c2ef7034d3a2d6905e3cf5c63c5d83c
Enabling the stake validation checks the eligibility in
TestBlockValidity
which is called inCreateNewBock
inminer.cpp
when theTransactionPicker
(implementation:BlockAssemblerAdapter
) invokes it to gather a list of transactions to include in a block. This pseudo-block which is created does not have eligible stake (for the same reason the merkle check is skipped, already in existing bitcoin code).This fixes that by introducig a clean flag to bypass that check (much like the previous flags which also bypassed certain checks, but using the
XXXFlags
fromvalidation_flags.h
instead of boolean flags - which in my mind/experience are a code smell and should be avoided).