File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 2121
2222 GO_VERSION : ' 1.23.6'
2323
24- LITD_ITEST_BRANCH : ' script-key-migrations '
24+ LITD_ITEST_BRANCH : ' master '
2525
2626jobs :
2727 # ######################
Original file line number Diff line number Diff line change @@ -154,13 +154,12 @@ func (h *StreamHandler) HandleOutgoingMessage(
154154 ctx , cancel := h .WithCtxQuitNoTimeout ()
155155 defer cancel ()
156156
157- err = h .cfg .PeerMessenger .SendCustomMessage (ctx , lndClientCustomMsg )
158- if err != nil {
159- return fmt .Errorf ("unable to send message to peer: %w" ,
160- err )
161- }
162-
163- // Store outgoing requests.
157+ // We store the outgoing request in the request map, so we can interpret
158+ // any response and map it to the original request. We do this before
159+ // sending the message, because otherwise we could potentially receive
160+ // the response while we're waiting for the atomic lock to be released,
161+ // which would lead to us not knowing about the request in the first
162+ // place, and we couldn't map the response.
164163 switch msg := outgoingMsg .(type ) {
165164 case * rfqmsg.BuyRequest :
166165 h .outgoingRequests .Store (msg .ID , msg )
@@ -173,6 +172,12 @@ func (h *StreamHandler) HandleOutgoingMessage(
173172 msg .ID .String ())
174173 }
175174
175+ err = h .cfg .PeerMessenger .SendCustomMessage (ctx , lndClientCustomMsg )
176+ if err != nil {
177+ return fmt .Errorf ("unable to send message to peer: %w" ,
178+ err )
179+ }
180+
176181 return nil
177182}
178183
You can’t perform that action at this time.
0 commit comments