diff --git a/src/ripple/app/tx/impl/CreateOffer.cpp b/src/ripple/app/tx/impl/CreateOffer.cpp index dd05565653..02467c0570 100644 --- a/src/ripple/app/tx/impl/CreateOffer.cpp +++ b/src/ripple/app/tx/impl/CreateOffer.cpp @@ -421,6 +421,13 @@ CreateOffer::format_amount (STAmount const& amount) STAmount CreateOffer::getAccountReserve (SLE::pointer account) { + // Mon Aug 3 11:00:00am PDT + static NetClock::time_point const switchoverTime ( + std::chrono::seconds (491940000)); + if (ctx_.view().info().parentCloseTime <= + switchoverTime.time_since_epoch().count()) + return STAmount (ctx_.view().fees().accountReserve( + deprecatedWrongOwnerCount_+1)); return STAmount (ctx_.view().fees().accountReserve( account->getFieldU32 (sfOwnerCount) + 1)); } @@ -559,6 +566,8 @@ CreateOffer::applyGuts (ApplyView& view, ApplyView& view_cancel) auto const sleCreator = view.peek ( keylet::account(account_)); + deprecatedWrongOwnerCount_ = sleCreator->getFieldU32(sfOwnerCount); + std::uint32_t const uAccountSequenceNext = sleCreator->getFieldU32 (sfSequence); std::uint32_t const uSequence = mTxn.getSequence (); diff --git a/src/ripple/app/tx/impl/CreateOffer.h b/src/ripple/app/tx/impl/CreateOffer.h index 9a9595dc84..5295219ddb 100644 --- a/src/ripple/app/tx/impl/CreateOffer.h +++ b/src/ripple/app/tx/impl/CreateOffer.h @@ -112,6 +112,7 @@ private: private: // What kind of offer we are placing CrossType cross_type_; + std::uint32_t deprecatedWrongOwnerCount_; }; } diff --git a/src/ripple/ledger/ReadView.h b/src/ripple/ledger/ReadView.h index 82ba426431..3930b2d2f7 100644 --- a/src/ripple/ledger/ReadView.h +++ b/src/ripple/ledger/ReadView.h @@ -21,6 +21,7 @@ #define RIPPLE_LEDGER_READVIEW_H_INCLUDED #include +#include #include #include #include