diff --git a/wire/protocol.go b/wire/protocol.go index 26797c70..30fdb01e 100644 --- a/wire/protocol.go +++ b/wire/protocol.go @@ -66,6 +66,10 @@ const ( // SFNodeBloom is a flag used to indicate a peer supports bloom // filtering. SFNodeBloom + + // SFNodeWitness is a flag used to indicate a peer supports blocks + // and transactions including witness data (BIP0144). + SFNodeWitness ) // Map of service flags back to their constant names for pretty printing. @@ -73,6 +77,7 @@ var sfStrings = map[ServiceFlag]string{ SFNodeNetwork: "SFNodeNetwork", SFNodeGetUTXO: "SFNodeGetUTXO", SFNodeBloom: "SFNodeBloom", + SFNodeWitness: "SFNodeWitness", } // orderedSFStrings is an ordered list of service flags from highest to @@ -81,6 +86,7 @@ var orderedSFStrings = []ServiceFlag{ SFNodeNetwork, SFNodeGetUTXO, SFNodeBloom, + SFNodeWitness, } // String returns the ServiceFlag in human-readable form. diff --git a/wire/protocol_test.go b/wire/protocol_test.go index accc0495..db9991f4 100644 --- a/wire/protocol_test.go +++ b/wire/protocol_test.go @@ -16,7 +16,8 @@ func TestServiceFlagStringer(t *testing.T) { {SFNodeNetwork, "SFNodeNetwork"}, {SFNodeGetUTXO, "SFNodeGetUTXO"}, {SFNodeBloom, "SFNodeBloom"}, - {0xffffffff, "SFNodeNetwork|SFNodeGetUTXO|SFNodeBloom|0xfffffff8"}, + {SFNodeWitness, "SFNodeWitness"}, + {0xffffffff, "SFNodeNetwork|SFNodeGetUTXO|SFNodeBloom|SFNodeWitness|0xfffffff0"}, } t.Logf("Running %d tests", len(tests))