Introduce a service flag for CBFs.
Add a service flag for CBFs in the wire protocol.
This commit is contained in:
parent
1432d294a5
commit
d82e76cec9
2 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
// XXX pedro: we will probably need to bump this.
|
||||
const (
|
||||
// ProtocolVersion is the latest protocol version this package supports.
|
||||
ProtocolVersion uint32 = 70013
|
||||
|
@ -70,6 +71,10 @@ const (
|
|||
// SFNodeWitness is a flag used to indicate a peer supports blocks
|
||||
// and transactions including witness data (BIP0144).
|
||||
SFNodeWitness
|
||||
|
||||
// SFNNodeCBF is a flag used to indicate a peer supports committed
|
||||
// bloom filters (CBFs).
|
||||
SFNodeCBF
|
||||
)
|
||||
|
||||
// Map of service flags back to their constant names for pretty printing.
|
||||
|
@ -78,6 +83,7 @@ var sfStrings = map[ServiceFlag]string{
|
|||
SFNodeGetUTXO: "SFNodeGetUTXO",
|
||||
SFNodeBloom: "SFNodeBloom",
|
||||
SFNodeWitness: "SFNodeWitness",
|
||||
SFNodeCBF: "SFNodeCBF",
|
||||
}
|
||||
|
||||
// orderedSFStrings is an ordered list of service flags from highest to
|
||||
|
@ -87,6 +93,7 @@ var orderedSFStrings = []ServiceFlag{
|
|||
SFNodeGetUTXO,
|
||||
SFNodeBloom,
|
||||
SFNodeWitness,
|
||||
SFNodeCBF,
|
||||
}
|
||||
|
||||
// String returns the ServiceFlag in human-readable form.
|
||||
|
|
|
@ -18,6 +18,8 @@ func TestServiceFlagStringer(t *testing.T) {
|
|||
{SFNodeBloom, "SFNodeBloom"},
|
||||
{SFNodeWitness, "SFNodeWitness"},
|
||||
{0xffffffff, "SFNodeNetwork|SFNodeGetUTXO|SFNodeBloom|SFNodeWitness|0xfffffff0"},
|
||||
{SFNodeCBF, "SFNodeCBF"},
|
||||
{0xffffffff, "SFNodeNetwork|SFNodeGetUTXO|SFNodeBloom|SFNodeCBF|0xfffffff0"},
|
||||
}
|
||||
|
||||
t.Logf("Running %d tests", len(tests))
|
||||
|
|
Loading…
Reference in a new issue