File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -577,12 +577,12 @@ class Swaps extends EventEmitter {
577577
578578 const routeAbsoluteTimeLock = makerToTakerRoute . getTotalTimeLock ( ) ;
579579 const routeLockDuration = routeAbsoluteTimeLock - height ;
580- const routeLockHours = Math . round ( routeLockDuration / takerSwapClient . minutesPerBlock ) ;
580+ const routeLockHours = Math . round ( routeLockDuration * takerSwapClient . minutesPerBlock / 60 ) ;
581581 this . logger . debug ( `found route to taker with total lock duration of ${ routeLockDuration } ${ takerCurrency } blocks (~${ routeLockHours } h)` ) ;
582582 deal . takerMaxTimeLock = routeLockDuration ;
583583
584584 const makerClientLockBuffer = this . swapClientManager . get ( makerCurrency ) ! . lockBuffer ;
585- const makerClientLockBufferHours = Math . round ( makerClientLockBuffer / makerSwapClient . minutesPerBlock ) ;
585+ const makerClientLockBufferHours = Math . round ( makerClientLockBuffer * makerSwapClient . minutesPerBlock / 60 ) ;
586586 this . logger . debug ( `maker client lock buffer: ${ makerClientLockBuffer } ${ makerCurrency } blocks (~${ makerClientLockBufferHours } h)` ) ;
587587
588588 /** The ratio of the average time for blocks on the taker (2nd leg) currency per blocks on the maker (1st leg) currency. */
@@ -594,7 +594,7 @@ class Swaps extends EventEmitter {
594594 // the total lock duration of the taker route times a factor to convert taker blocks to maker
595595 // blocks. This is to ensure that the 1st leg payment HTLC doesn't expire before the 2nd leg.
596596 deal . makerCltvDelta = makerClientLockBuffer + Math . ceil ( routeLockDuration * blockTimeFactor ) ;
597- const makerCltvDeltaHours = Math . round ( deal . makerCltvDelta / makerSwapClient . minutesPerBlock ) ;
597+ const makerCltvDeltaHours = Math . round ( deal . makerCltvDelta * makerSwapClient . minutesPerBlock / 60 ) ;
598598 this . logger . debug ( `calculated lock delta for final hop to maker: ${ deal . makerCltvDelta } ${ makerCurrency } blocks (~${ makerCltvDeltaHours } h)` ) ;
599599 }
600600
You can’t perform that action at this time.
0 commit comments