mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-15 18:10:26 +01:00
Merge bitcoin/bitcoin#21090: Default to NODE_WITNESS in nLocalServices
a806647d26[validation] Always include merkle root in coinbase commitment (Dhruv Mehta)189128c220[validation] Set witness script flag with p2sh for blocks (Dhruv Mehta)ac82b99db7[p2p] remove redundant NODE_WITNESS checks (Dhruv Mehta)6f8b198b82[p2p] remove unused segwitheight=-1 option (Dhruv Mehta)eba5b1cd64[test] remove or move tests using `-segwitheight=-1` (Dhruv Mehta) Pull request description: Builds on #21009 and makes progress on remaining items in #17862 Removing `RewindBlockIndex()` in #21009 allows the following: - removal of tests using `segwitheight=-1` in `p2p_segwit.py`. - move `test_upgrade_after_activation()` out of `p2p_segwit.py` reducing runtime - in turn, that allows us to drop support for `-segwitheight=-1`, which is only supported for that test. - that allows us to always set `NODE_WITNESS` in our local services. The only reason we don't do that is to support `-segwitheight=-1`. - that in turn allows us to drop all of the `GetLocalServices() & NODE_WITNESS` checks inside `net_processing.cpp`, since our local services would always include `NODE_WITNESS` ACKs for top commit: mzumsande: Code-Review ACKa806647d26laanwj: Code review ACKa806647d26, nice cleanup jnewbery: utACKa806647d26theStack: ACKa806647d26Tree-SHA512: 73e1a69d1d7eca1f5c38558ec6672decd0b60b16c2ef6134df6f6af71bb159e6eea160f9bb5ab0eb6723c6632d29509811e29469d0d87abbe9b69a2890fbc73e
This commit is contained in:
@@ -490,11 +490,8 @@ void CRegTestParams::UpdateActivationParametersFromArgs(const ArgsManager& args)
|
||||
{
|
||||
if (args.IsArgSet("-segwitheight")) {
|
||||
int64_t height = args.GetArg("-segwitheight", consensus.SegwitHeight);
|
||||
if (height < -1 || height >= std::numeric_limits<int>::max()) {
|
||||
throw std::runtime_error(strprintf("Activation height %ld for segwit is out of valid range. Use -1 to disable segwit.", height));
|
||||
} else if (height == -1) {
|
||||
LogPrintf("Segwit disabled for testing\n");
|
||||
height = std::numeric_limits<int>::max();
|
||||
if (height < 0 || height >= std::numeric_limits<int>::max()) {
|
||||
throw std::runtime_error(strprintf("Activation height %ld for segwit is out of valid range.", height));
|
||||
}
|
||||
consensus.SegwitHeight = static_cast<int>(height);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user