File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
- // Copyright 2024 Blink Labs Software
1
+ // Copyright 2025 Blink Labs Software
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@ package txsubmission
16
16
17
17
import (
18
18
"fmt"
19
+ "math"
19
20
"sync"
20
21
21
22
"github.com/blinklabs-io/gouroboros/ledger/common"
@@ -93,7 +94,18 @@ func (s *Server) RequestTxIds(
93
94
"role" , "server" ,
94
95
"connection_id" , s .callbackContext .ConnectionId .String (),
95
96
)
96
- msg := NewMsgRequestTxIds (blocking , uint16 (s .ackCount ), uint16 (reqCount ))
97
+ var ack , req uint16
98
+ if s .ackCount > 0 && s .ackCount <= math .MaxUint16 {
99
+ ack = uint16 (s .ackCount )
100
+ } else if s .ackCount > math .MaxUint16 {
101
+ ack = math .MaxUint16
102
+ }
103
+ if reqCount > 0 && reqCount <= math .MaxUint16 {
104
+ req = uint16 (reqCount )
105
+ } else if reqCount > math .MaxUint16 {
106
+ req = math .MaxUint16
107
+ }
108
+ msg := NewMsgRequestTxIds (blocking , ack , req )
97
109
if err := s .SendMessage (msg ); err != nil {
98
110
return nil , err
99
111
}
You can’t perform that action at this time.
0 commit comments