Skip to content

Commit

Permalink
move guard
Browse files Browse the repository at this point in the history
  • Loading branch information
dangell7 committed Oct 17, 2023
1 parent 16fc7b2 commit d65afe7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ripple/app/tx/impl/PayChan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ PayChanCreate::doApply()
if (!sle)
return tefINTERNAL;

if (ctx_.view().rules().enabled(fixPayChanCancelAfter))
{
auto const closeTime = ctx_.view().info().parentCloseTime;
if (ctx_.tx[~sfCancelAfter] && after(closeTime, ctx_.tx[sfCancelAfter]))
return tecEXPIRED;
}

auto const dst = ctx_.tx[sfDestination];

// Create PayChan in ledger.
Expand All @@ -270,13 +277,6 @@ PayChanCreate::doApply()
(*slep)[~sfSourceTag] = ctx_.tx[~sfSourceTag];
(*slep)[~sfDestinationTag] = ctx_.tx[~sfDestinationTag];

if (ctx_.view().rules().enabled(fixPayChanCancelAfter))
{
auto const closeTime = ctx_.view().info().parentCloseTime;
if (ctx_.tx[~sfCancelAfter] && after(closeTime, ctx_.tx[sfCancelAfter]))
return tecEXPIRED;
}

ctx_.view().insert(slep);

// Add PayChan to owner directory
Expand Down

0 comments on commit d65afe7

Please sign in to comment.