Refactor ledger open check in OfferCreate.cpp

This commit is contained in:
Mayukha Vadari
2026-03-18 17:30:24 -04:00
committed by GitHub
parent d360e7c5b6
commit 4cdc8561cd

View File

@@ -562,7 +562,6 @@ OfferCreate::applyGuts(Sandbox& sb, Sandbox& sbCancel)
return {tecEXPIRED, true};
}
bool const bOpenLedger = sb.open();
bool crossed = false;
if (isTesSuccess(result))
@@ -648,7 +647,8 @@ OfferCreate::applyGuts(Sandbox& sb, Sandbox& sbCancel)
stream << " out: " << format_amount(place_offer.out);
}
if (result == tecFAILED_PROCESSING && bOpenLedger)
bool const isLedgerOpen = sb.open();
if (result == tecFAILED_PROCESSING && isLedgerOpen)
result = telFAILED_PROCESSING;
if (!isTesSuccess(result))