diff --git a/src/ripple/app/tx/impl/Escrow.cpp b/src/ripple/app/tx/impl/Escrow.cpp index 4a020f7cd..1b5d559b1 100644 --- a/src/ripple/app/tx/impl/Escrow.cpp +++ b/src/ripple/app/tx/impl/Escrow.cpp @@ -438,7 +438,8 @@ EscrowFinish::preflight(PreflightContext const& ctx) if (!ctx.tx.isFieldPresent(sfOfferSequence)) return temMALFORMED; - if (ctx.tx.isFieldPresent(sfEscrowID) && ctx.tx.getFieldU32(sfOfferSequence) != 0) + if (ctx.tx.isFieldPresent(sfEscrowID) && + ctx.tx.getFieldU32(sfOfferSequence) != 0) return temMALFORMED; } else @@ -720,7 +721,8 @@ EscrowCancel::preflight(PreflightContext const& ctx) if (!ctx.tx.isFieldPresent(sfOfferSequence)) return temMALFORMED; - if (ctx.tx.isFieldPresent(sfEscrowID) && ctx.tx.getFieldU32(sfOfferSequence) != 0) + if (ctx.tx.isFieldPresent(sfEscrowID) && + ctx.tx.getFieldU32(sfOfferSequence) != 0) return temMALFORMED; } else diff --git a/src/ripple/app/tx/impl/URIToken.cpp b/src/ripple/app/tx/impl/URIToken.cpp index d81d2c382..a2d4c2ee4 100644 --- a/src/ripple/app/tx/impl/URIToken.cpp +++ b/src/ripple/app/tx/impl/URIToken.cpp @@ -240,7 +240,7 @@ URIToken::preclaim(PreclaimContext const& ctx) if (purchaseAmount.native() && saleAmount->native()) { // native transfer - + STAmount needed{ctx.view.fees().accountReserve( sle->getFieldU32(sfOwnerCount) + 1)}; @@ -267,16 +267,20 @@ URIToken::preclaim(PreclaimContext const& ctx) // iou transfer STAmount availableFunds{accountFunds( - ctx.view, acc, purchaseAmount, fhZERO_IF_FROZEN, ctx.j)}; + ctx.view, + acc, + purchaseAmount, + fhZERO_IF_FROZEN, + ctx.j)}; if (purchaseAmount > availableFunds) return tecINSUFFICIENT_FUNDS; } } else - { + { // old logic - + if (purchaseAmount.native() && saleAmount->native()) { // if it's an xrp sale/purchase then no trustline needed @@ -288,12 +292,15 @@ URIToken::preclaim(PreclaimContext const& ctx) { // iou STAmount availableFunds{accountFunds( - ctx.view, acc, purchaseAmount, fhZERO_IF_FROZEN, ctx.j)}; + ctx.view, + acc, + purchaseAmount, + fhZERO_IF_FROZEN, + ctx.j)}; if (purchaseAmount > availableFunds) return tecINSUFFICIENT_FUNDS; } - } return tesSUCCESS; } diff --git a/src/test/app/URIToken_test.cpp b/src/test/app/URIToken_test.cpp index ced5f4686..79088f579 100644 --- a/src/test/app/URIToken_test.cpp +++ b/src/test/app/URIToken_test.cpp @@ -455,12 +455,8 @@ struct URIToken_test : public beast::unit_test::suite // setup env Env env{ - *this, - envconfig(), - features, - nullptr, - beast::severities::kWarning - //beast::severities::kTrace + *this, envconfig(), features, nullptr, beast::severities::kWarning + // beast::severities::kTrace }; auto const alice = Account("alice"); auto const bob = Account("bob");