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,
694
694
// update notification.
695
695
func (s * loopInSwap ) persistAndAnnounceState (ctx context.Context ) error {
696
696
// 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 (
698
708
s .hash , s .lastUpdateTime ,
699
709
loopdb.SwapStateData {
700
710
State : s .state ,
701
711
Cost : s .cost ,
702
712
},
703
713
)
704
- if err != nil {
705
- return err
706
- }
707
-
708
- // Send out swap update
709
- return s .sendUpdate (ctx )
710
714
}
711
715
712
716
// setState updates the swap state and last update timestamp.
You can’t perform that action at this time.
0 commit comments