Open fshutdown opened 6 years ago
Might be related to issue #1028
Looks similar but in the case I've described above the SegWit gets activated from block 3 which is causing the chain no to sync. This might be related to fact that I'm connecting to BitcoinCore rather than another SBFN node.
Note that TestSegwit_MinedOnCore_ActivatedOn_StratisNode
already implicitly tests what you are describing, although it is not an exhaustive test. Maybe we need to re-visit it, it is possible it does not adequately highlight potential Segwit rule issues.
In that case I would recommend this test to be reviewed as well. I found this problem when testing end-to-end with all nodes running as the end user would do.
Setup FullNode connected to two Bitcoin Core 0.15.1 instances using
-addnode
commandline switch.Problem SBFN is rejecting blocks generated by BitCoin Core after block 2. The problem has been found on the RegTest network but could impact other networks as well.
Quick hack As a temporary hack to get the code to wort I have added a check for the blockheight to decide whether the SegWit code branch should be executed. This is not a solution but rather an aid in helping to visualise a problem.
Stratis.Bitcoin.Features.Consensus.Rules.CommonRules.WitnessCommitmentsRule Change made to add additional condition for block height
context.BlockValidationContext.ChainedBlock.Height >= 432
This fix addresses only SegWit on Regtest.if (deploymentFlags.ScriptFlags.HasFlag(ScriptVerify.Witness) && context.BlockValidationContext.ChainedBlock.Height >= 432)