From fdedbf86f8bd7454d8f0c1e9df717b4ea4fca214 Mon Sep 17 00:00:00 2001 From: Roy Lee Date: Sat, 6 Aug 2022 11:10:45 -0700 Subject: [PATCH] mining: include 'segwit' rule when no segwit txns in GBT According to the BIP0009, all active softfork deployment should be included in the rules. We add the '!' to indicate the enforcement if the template has any segwit transactions in it. Otherwise, plain `segwit` is fine. --- rpcserver.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rpcserver.go b/rpcserver.go index 96f92201..55b0485e 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1900,6 +1900,8 @@ func (state *gbtWorkState) blockTemplateResult(useCoinbaseValue bool, submitOld if template.WitnessCommitment != nil { reply.DefaultWitnessCommitment = hex.EncodeToString(template.WitnessCommitment) reply.Rules = append(reply.Rules, "!segwit") + } else { + reply.Rules = append(reply.Rules, "segwit") } if useCoinbaseValue {