disallow specifying both escrowid and offsersequence on escrow

This commit is contained in:
Richard Holland
2023-12-22 12:23:42 +00:00
parent 97acfe9f97
commit c3175e1fd4

View File

@@ -439,8 +439,9 @@ EscrowFinish::preflight(PreflightContext const& ctx)
return temMALFORMED;
}
if (!ctx.tx.isFieldPresent(sfEscrowID) &&
!ctx.tx.isFieldPresent(sfOfferSequence))
if ((!ctx.tx.isFieldPresent(sfEscrowID) &&
!ctx.tx.isFieldPresent(sfOfferSequence)) ||
ctx.isFieldPresent(sfEscrowID) && ctx.isFieldPresent(sfOfferSequence))
return temMALFORMED;
return tesSUCCESS;
@@ -725,8 +726,10 @@ EscrowCancel::preflight(PreflightContext const& ctx)
return temMALFORMED;
}
if (!ctx.tx.isFieldPresent(sfEscrowID) &&
!ctx.tx.isFieldPresent(sfOfferSequence))
if ((!ctx.tx.isFieldPresent(sfEscrowID) &&
!ctx.tx.isFieldPresent(sfOfferSequence)) ||
ctx.tx.isFieldPresent(sfEscrowID) &&
ctx.tx.isFieldPresent(sfOfferSequence))
return temMALFORMED;
return preflight2(ctx);