Skip to content

Commit

Permalink
refactor: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiuszos4chain committed Nov 12, 2024
1 parent a3d99af commit ea6b386
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions internal/blocktx/health_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestCheck(t *testing.T) {
peerMq := &better_p2p_mocks.PeerIMock{}
peerMq.NetworkFunc = func() wire.BitcoinNet { return wire.TestNet }
peerMq.ConnectedFunc = func() bool { return false }
pm.AddPeer(peerMq)
_ = pm.AddPeer(peerMq)

sut, err := blocktx.NewServer("", 0, logger, storeMock, pm, 0, nil)
require.NoError(t, err)
Expand Down Expand Up @@ -140,7 +140,7 @@ func TestWatch(t *testing.T) {
peerMq := &better_p2p_mocks.PeerIMock{}
peerMq.NetworkFunc = func() wire.BitcoinNet { return wire.TestNet }
peerMq.ConnectedFunc = func() bool { return false }
pm.AddPeer(peerMq)
_ = pm.AddPeer(peerMq)

sut, err := blocktx.NewServer("", 0, logger, storeMock, pm, 0, nil)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/blocktx/p2p/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ func (h *PeerMsgHandler) OnReceive(wireMsg wire.Message, peer better_p2p.PeerI)
}
}

func (h *PeerMsgHandler) OnSend(msg wire.Message, peer better_p2p.PeerI) {
func (h *PeerMsgHandler) OnSend(_ wire.Message, _ better_p2p.PeerI) {
// ignore
}
2 changes: 0 additions & 2 deletions internal/metamorph/p2p/message_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func (h *PeerMsgHandler) OnReceive(wireMsg wire.Message, peer better_p2p.PeerI)
}:
default: // Ensure that writing to channel is non-blocking
}

}
}

Expand Down Expand Up @@ -139,7 +138,6 @@ func (h *PeerMsgHandler) OnReceive(wireMsg wire.Message, peer better_p2p.PeerI)
func (h *PeerMsgHandler) OnSend(wireMsg wire.Message, peer better_p2p.PeerI) {
cmd := wireMsg.Command()
switch cmd {

case wire.CmdTx:
msg, ok := wireMsg.(*wire.MsgTx)
if !ok {
Expand Down
2 changes: 0 additions & 2 deletions internal/metamorph/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,6 @@ func (p *Processor) StartProcessExpiredTransactions() {
requested++
//continue
} else {

p.logger.Debug("Re-announcing expired tx", slog.String("hash", tx.Hash.String()))
toAnnounce = append(toAnnounce, tx.Hash)
// peers := p.pm.AnnounceTransaction(tx.Hash, nil)
Expand Down Expand Up @@ -658,7 +657,6 @@ func (p *Processor) StartProcessExpiredTransactions() {
p.logger.Warn("transaction was not announced to any peer during rebroadcast")
}
}

}

if announced > 0 || requested > 0 {
Expand Down

0 comments on commit ea6b386

Please sign in to comment.