mirror of
https://github.com/AthanorLabs/atomic-swap.git
synced 2026-01-10 06:38:04 -05:00
fix: run t1 handler on xmrmaker ongoing swap restart (#457)
This commit is contained in:
@@ -192,6 +192,13 @@ func (s *swapState) runT1ExpirationHandler() {
|
||||
time.Until(s.t1).Seconds(),
|
||||
)
|
||||
|
||||
if time.Until(s.t2) < 0 {
|
||||
log.Debugf("t2 (%s) has already passed; not starting t1 expiration handler",
|
||||
s.t2.Format(common.TimeFmtSecs),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
waitCtx, waitCtxCancel := context.WithCancel(context.Background())
|
||||
defer waitCtxCancel() // Unblock WaitForTimestamp if still running when we exit
|
||||
|
||||
|
||||
@@ -317,6 +317,8 @@ func newSwapStateFromOngoing(
|
||||
s.pubkeys = sk.PublicKeyPair()
|
||||
s.contractSwapID = ethSwapInfo.SwapID
|
||||
s.contractSwap = ethSwapInfo.Swap
|
||||
|
||||
go s.runT1ExpirationHandler()
|
||||
return s, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user