From 9c238a8341bcb199c4e4e62e0cf0fc0a9c5800d8 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 17 May 2016 15:36:33 -0500 Subject: [PATCH] wire: Use ordered Service Flags. (#182) This modifies the wire.ServiceFlag stringer to use the ordered slice of flags to ensure that the human readable representation of the flags is always in a well defined order. This is not only useful for humans, but it also allows the output to be deterministically tested. --- wire/protocol.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/protocol.go b/wire/protocol.go index 33ea39ab..f36b2a31 100644 --- a/wire/protocol.go +++ b/wire/protocol.go @@ -54,9 +54,9 @@ func (f ServiceFlag) String() string { // Add individual bit flags. s := "" - for flag, name := range sfStrings { + for _, flag := range orderedSFStrings { if f&flag == flag { - s += name + "|" + s += sfStrings[flag] + "|" f -= flag } }