mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improve version switchover semantics:
* Support PreviousTxnID until the switchover * Implement "No Ripple" for issue_iou and redeem_iou. * Do not utilize issue_iou and redeem_iou from legacy code * Rename 0.27.x legacy files to account for VS build process * Misc. cleanups
This commit is contained in:
@@ -29,8 +29,10 @@
|
||||
#include <ripple/protocol/TxFlags.h>
|
||||
#include <ripple/basics/StringUtilities.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/legacy/0.27/Emulate027.h>
|
||||
#include <beast/unit_test/suite.h>
|
||||
#include <boost/format.hpp>
|
||||
#include "boost/date_time/posix_time/posix_time.hpp"
|
||||
#include <array>
|
||||
|
||||
namespace ripple {
|
||||
@@ -290,7 +292,14 @@ isMemoOkay (STObject const& st, std::string& reason)
|
||||
if (!st.isFieldPresent (sfMemos))
|
||||
return true;
|
||||
|
||||
const STArray& memos = st.getFieldArray (sfMemos);
|
||||
// We switch to new semantics on April 15, 2015 at 1:00pm PDT:
|
||||
static boost::posix_time::ptime const cutoff (
|
||||
boost::posix_time::time_from_string ("2015-04-15 20:00:00"));
|
||||
|
||||
bool const emulate027 =
|
||||
boost::posix_time::second_clock::universal_time () < cutoff;
|
||||
|
||||
auto const& memos = st.getFieldArray (sfMemos);
|
||||
|
||||
// The number 2048 is a preallocation hint, not a hard limit
|
||||
// to avoid allocate/copy/free's
|
||||
@@ -327,6 +336,9 @@ isMemoOkay (STObject const& st, std::string& reason)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (emulate027)
|
||||
continue;
|
||||
|
||||
// The raw data is stored as hex-octets, which we want to decode.
|
||||
auto data = strUnHex (memoElement.getText ());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user