Skip to content

Commit e1f414e

Browse files
authored
refactor: don't log tx-submission error on shutdown (#805)
Fixes #804 Signed-off-by: Aurora Gaffney <[email protected]>
1 parent c22a920 commit e1f414e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

txsubmission.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"github.com/blinklabs-io/dingo/mempool"
2424
ouroboros "github.com/blinklabs-io/gouroboros"
2525
"github.com/blinklabs-io/gouroboros/ledger"
26+
"github.com/blinklabs-io/gouroboros/protocol"
2627
"github.com/blinklabs-io/gouroboros/protocol/txsubmission"
2728
)
2829

@@ -67,9 +68,14 @@ func (n *Node) txsubmissionServerInit(ctx txsubmission.CallbackContext) error {
6768
txsubmissionRequestTxIdsCount,
6869
)
6970
if err != nil {
71+
// Peer requested shutdown
7072
if errors.Is(err, txsubmission.ErrStopServerProcess) {
7173
return
7274
}
75+
// Don't log on connection close
76+
if errors.Is(err, protocol.ErrProtocolShuttingDown) {
77+
return
78+
}
7379
n.config.logger.Error(
7480
fmt.Sprintf(
7581
"failed to get TxIds: %s",

0 commit comments

Comments
 (0)