Skip to content

Commit

Permalink
wire: Remove deprecated reject message support.
Browse files Browse the repository at this point in the history
This removes code for accepting reject messages which are no longer
supported by the network.

Since removing the type definition itself would be a major module
version bump, it is not removed at this time and instead the ability to
recognize the message is removed so that any attempts to read the
message will result in a protocol error.

The type and associated test code can be removed on a major module
version bump.
  • Loading branch information
davecgh committed May 10, 2024
1 parent fb004ad commit 5c616aa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 1 addition & 4 deletions wire/message.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2013-2016 The btcsuite developers
// Copyright (c) 2015-2023 The Decred developers
// Copyright (c) 2015-2024 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -156,9 +156,6 @@ func makeEmptyMessage(command string) (Message, error) {
case CmdGetMiningState:
msg = &MsgGetMiningState{}

case CmdReject:
msg = &MsgReject{}

case CmdSendHeaders:
msg = &MsgSendHeaders{}

Expand Down
2 changes: 0 additions & 2 deletions wire/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func TestMessage(t *testing.T) {
[]byte("payload"))
msgCFHeaders := NewMsgCFHeaders()
msgCFTypes := NewMsgCFTypes([]FilterType{GCSFilterExtended})
msgReject := NewMsgReject("block", RejectDuplicate, "duplicate block")
msgGetInitState := NewMsgGetInitState()
msgInitState := NewMsgInitState()
msgMixPR, err := NewMsgMixPairReq([33]byte{}, 1, 1, "", 1, 1, 1, 1, []MixPairReqUTXO{}, NewTxOut(0, []byte{}), 1, 1)
Expand Down Expand Up @@ -113,7 +112,6 @@ func TestMessage(t *testing.T) {
{msgGetHeaders, msgGetHeaders, pver, MainNet, 61},
{msgHeaders, msgHeaders, pver, MainNet, 25},
{msgMemPool, msgMemPool, pver, MainNet, 24},
{msgReject, msgReject, RemoveRejectVersion - 1, MainNet, 79},
{msgGetCFilter, msgGetCFilter, pver, MainNet, 57},
{msgGetCFHeaders, msgGetCFHeaders, pver, MainNet, 58},
{msgGetCFTypes, msgGetCFTypes, pver, MainNet, 24},
Expand Down

0 comments on commit 5c616aa

Please sign in to comment.