From 1a4c3593518594632bd16a0af66af0904306be32 Mon Sep 17 00:00:00 2001 From: Mayukha Vadari Date: Mon, 16 Mar 2026 14:14:59 -0400 Subject: [PATCH] refactor: use `hasExpired` in `CancelCheck` (#6533) --- src/libxrpl/tx/transactors/check/CancelCheck.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/libxrpl/tx/transactors/check/CancelCheck.cpp b/src/libxrpl/tx/transactors/check/CancelCheck.cpp index 645327a4c5..59d80fb27e 100644 --- a/src/libxrpl/tx/transactors/check/CancelCheck.cpp +++ b/src/libxrpl/tx/transactors/check/CancelCheck.cpp @@ -25,15 +25,11 @@ CancelCheck::preclaim(PreclaimContext const& ctx) return tecNO_ENTRY; } - using duration = NetClock::duration; - using timepoint = NetClock::time_point; - auto const optExpiry = (*sleCheck)[~sfExpiration]; - // Expiration is defined in terms of the close time of the parent // ledger, because we definitively know the time that it closed but // we do not know the closing time of the ledger that is under // construction. - if (!optExpiry || (ctx.view.parentCloseTime() < timepoint{duration{*optExpiry}})) + if (!hasExpired(ctx.view, (*sleCheck)[~sfExpiration])) { // If the check is not yet expired, then only the creator or the // destination may cancel the check.