File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -694,19 +694,23 @@ func (s *loopInSwap) publishTimeoutTx(ctx context.Context,
694694// update notification.
695695func (s * loopInSwap ) persistAndAnnounceState (ctx context.Context ) error {
696696 // Update state in store.
697- err := s .store .UpdateLoopIn (
697+ if err := s .persistState (); err != nil {
698+ return err
699+ }
700+
701+ // Send out swap update
702+ return s .sendUpdate (ctx )
703+ }
704+
705+ // persistState updates the swap state on disk.
706+ func (s * loopInSwap ) persistState () error {
707+ return s .store .UpdateLoopIn (
698708 s .hash , s .lastUpdateTime ,
699709 loopdb.SwapStateData {
700710 State : s .state ,
701711 Cost : s .cost ,
702712 },
703713 )
704- if err != nil {
705- return err
706- }
707-
708- // Send out swap update
709- return s .sendUpdate (ctx )
710714}
711715
712716// setState updates the swap state and last update timestamp.
You can’t perform that action at this time.
0 commit comments