File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,17 @@ func (c *Client) handleRequestTxIds(msg protocol.Message) error {
124
124
msgRequestTxIds .Req ,
125
125
)
126
126
if err != nil {
127
- return err
127
+ if ! errors .Is (err , ErrStopServerProcess ) {
128
+ return err
129
+ }
130
+ if ! msgRequestTxIds .Blocking {
131
+ return errors .New ("cannot stop server process during a non-blocking operation" )
132
+ }
133
+ resp := NewMsgDone ()
134
+ if err := c .SendMessage (resp ); err != nil {
135
+ return err
136
+ }
137
+ return nil
128
138
}
129
139
resp := NewMsgReplyTxIds (txIds )
130
140
if err := c .SendMessage (resp ); err != nil {
Original file line number Diff line number Diff line change
1
+ // Copyright 2025 Blink Labs Software
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ package txsubmission
16
+
17
+ import "errors"
18
+
19
+ // ErrStopServerProcess is used as a special return value from a RequestTxIds handler function to signify
20
+ // that the server should stop asking for transactions. This should only be used when the request is blocking
21
+ var ErrStopServerProcess = errors .New ("stop server process" )
You can’t perform that action at this time.
0 commit comments