Skip to content

Commit 4cd689c

Browse files
committed
loopin: public scope for ValidateLoopInContract
1 parent c4f3b98 commit 4cd689c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

loopin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig,
248248

249249
// Validate if the response parameters are outside our allowed range
250250
// preventing us from continuing with a swap.
251-
err = validateLoopInContract(currentHeight, swapResp)
251+
err = ValidateLoopInContract(currentHeight, swapResp.expiry)
252252
if err != nil {
253253
return nil, err
254254
}
@@ -429,11 +429,11 @@ func resumeLoopInSwap(_ context.Context, cfg *swapConfig,
429429
return swap, nil
430430
}
431431

432-
// validateLoopInContract validates the contract parameters against our request.
433-
func validateLoopInContract(height int32, response *newLoopInResponse) error {
432+
// ValidateLoopInContract validates the contract parameters against our request.
433+
func ValidateLoopInContract(height int32, htlcExpiry int32) error {
434434
// Verify that we are not forced to publish a htlc that locks up our
435435
// funds for too long in case the server doesn't follow through.
436-
if response.expiry-height > MaxLoopInAcceptDelta {
436+
if htlcExpiry-height > MaxLoopInAcceptDelta {
437437
return ErrExpiryTooFar
438438
}
439439

0 commit comments

Comments
 (0)