mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-22 03:55:53 +00:00
Fix tabs and trailing whitespace.
This commit is contained in:
@@ -1372,7 +1372,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
Revoke our outstanding proposal, if any, and
|
||||
cease proposing at least until this round ends
|
||||
*/
|
||||
@@ -1384,7 +1384,7 @@ private:
|
||||
{
|
||||
mOurPosition->bowOut();
|
||||
propose();
|
||||
}
|
||||
}
|
||||
mProposing = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void AcceptedLedgerTx::buildJson ()
|
||||
{
|
||||
affected.append (ra.humanAccountID ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mTxn->getTxnType () == ttOFFER_CREATE)
|
||||
{
|
||||
@@ -95,7 +95,7 @@ void AcceptedLedgerTx::buildJson ()
|
||||
if (account != amount.issue ().account)
|
||||
{
|
||||
LedgerEntrySet les (mLedger, tapNONE, true);
|
||||
auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE));
|
||||
auto const ownerFunds (les.accountFunds (account, amount, fhIGNORE_FREEZE));
|
||||
|
||||
mJson[jss::transaction][jss::owner_funds] = ownerFunds.getText ();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
|
||||
// VFALCO TODO Should this be called findOrAdd ?
|
||||
//
|
||||
virtual InboundLedger::pointer findCreate (uint256 const& hash,
|
||||
virtual InboundLedger::pointer findCreate (uint256 const& hash,
|
||||
std::uint32_t seq, InboundLedger::fcReason) = 0;
|
||||
|
||||
virtual InboundLedger::pointer find (LedgerHash const& hash) = 0;
|
||||
|
||||
@@ -1401,7 +1401,7 @@ bool Ledger::visitAccountItems (
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool found (false);
|
||||
for (;;)
|
||||
{
|
||||
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
SLE::pointer getAccountRoot (Account const& accountID) const;
|
||||
SLE::pointer getAccountRoot (const RippleAddress & naAccountID) const;
|
||||
void updateSkipList ();
|
||||
|
||||
|
||||
void visitAccountItems (
|
||||
Account const& accountID, std::function<void (SLE::ref)>) const;
|
||||
bool visitAccountItems (
|
||||
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
// See if the hash for the ledger we need is in the reference ledger
|
||||
ledgerHash = getLedgerHash(referenceLedger, ledgerIndex);
|
||||
if (ledgerHash.isZero())
|
||||
{
|
||||
{
|
||||
// No, Try to get another ledger that might have the hash we need
|
||||
// Compute the index and hash of a ledger that will have the hash we need
|
||||
LedgerIndex refIndex = (ledgerIndex + 255) & (~255);
|
||||
|
||||
@@ -51,7 +51,7 @@ bool ContinuousLedgerTiming::shouldClose (
|
||||
// no transactions so far this interval
|
||||
if (proposersClosed > (previousProposers / 4)) // did we miss a transaction?
|
||||
{
|
||||
WriteLog (lsTRACE, LedgerTiming) <<
|
||||
WriteLog (lsTRACE, LedgerTiming) <<
|
||||
"no transactions, many proposers: now (" << proposersClosed <<
|
||||
" closed, " << previousProposers << " before)";
|
||||
return true;
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
m_logs.journal("PathRequest"), m_collectorManager->collector ()))
|
||||
|
||||
, m_ledgerMaster (make_LedgerMaster (getConfig ().RUN_STANDALONE,
|
||||
getConfig ().FETCH_DEPTH, getConfig ().LEDGER_HISTORY,
|
||||
getConfig ().FETCH_DEPTH, getConfig ().LEDGER_HISTORY,
|
||||
getConfig ().getSize (siLedgerFetch), *m_jobQueue,
|
||||
m_collectorManager->collector (), m_logs.journal("LedgerMaster")))
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
, m_resourceFlags (0)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Cost (LoadType loadType, int cost, int resourceFlags)
|
||||
: m_loadType (loadType)
|
||||
, m_cost (cost)
|
||||
|
||||
@@ -527,7 +527,7 @@ int Pathfinder::getPathsOut (
|
||||
return it.first->second;
|
||||
|
||||
auto sleAccount = mLedger->getSLEi (Ledger::getAccountRootIndex (accountID));
|
||||
|
||||
|
||||
if (!sleAccount)
|
||||
return 0;
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ TER PathCursor::forwardLiquidityForAccount () const
|
||||
ledger().accountHolds (
|
||||
node().account_,
|
||||
xrpCurrency(),
|
||||
xrpAccount(),
|
||||
xrpAccount(),
|
||||
fhIGNORE_FREEZE)); // XRP can't be frozen
|
||||
|
||||
}
|
||||
|
||||
@@ -61,22 +61,22 @@ public:
|
||||
mProgress = true;
|
||||
mAggressive = false;
|
||||
}
|
||||
|
||||
|
||||
void clearProgress ()
|
||||
{
|
||||
mProgress = false;
|
||||
}
|
||||
|
||||
|
||||
bool isProgress ()
|
||||
{
|
||||
return mProgress;
|
||||
}
|
||||
|
||||
|
||||
void touch ()
|
||||
{
|
||||
mLastAction = m_clock.now();
|
||||
}
|
||||
|
||||
|
||||
clock_type::time_point getLastAction () const
|
||||
{
|
||||
return mLastAction;
|
||||
|
||||
@@ -175,7 +175,7 @@ bool SHAMap::compare (SHAMap::ref otherMap, Delta& differences, int maxCount)
|
||||
else if (ourNode->isLeaf () && otherNode->isInner ())
|
||||
{
|
||||
if (!otherMap->walkBranch (otherNode, ourNode->peekItem (),
|
||||
false, differences, maxCount))
|
||||
false, differences, maxCount))
|
||||
return false;
|
||||
}
|
||||
else if (ourNode->isInner () && otherNode->isInner ())
|
||||
@@ -233,20 +233,20 @@ void SHAMap::walkMap (std::vector<SHAMapMissingNode>& missingNodes, int maxMissi
|
||||
{
|
||||
if (!node->isEmptyBranch (i))
|
||||
{
|
||||
SHAMapTreeNode::pointer nextNode = descendNoStore (node, i);
|
||||
SHAMapTreeNode::pointer nextNode = descendNoStore (node, i);
|
||||
|
||||
if (nextNode)
|
||||
{
|
||||
if (nextNode->isInner ())
|
||||
nodeStack.push (std::move (nextNode));
|
||||
}
|
||||
else
|
||||
{
|
||||
missingNodes.emplace_back (mType, node->getChildHash (i));
|
||||
if (--maxMissing <= 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (nextNode)
|
||||
{
|
||||
if (nextNode->isInner ())
|
||||
nodeStack.push (std::move (nextNode));
|
||||
}
|
||||
else
|
||||
{
|
||||
missingNodes.emplace_back (mType, node->getChildHash (i));
|
||||
if (--maxMissing <= 0)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
AddWallet (
|
||||
SerializedTransaction const& txn,
|
||||
TransactionEngineParams params,
|
||||
TransactionEngine* engine)
|
||||
TransactionEngine* engine)
|
||||
: Transactor (
|
||||
txn,
|
||||
params,
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
return tecNO_ENTRY;
|
||||
|
||||
Account const ticket_owner (sleTicket->getFieldAccount160 (sfAccount));
|
||||
|
||||
|
||||
bool authorized (mTxnAccountID == ticket_owner);
|
||||
|
||||
// The target can also always remove a ticket
|
||||
|
||||
@@ -148,7 +148,7 @@ private:
|
||||
feeObject = mEngine->entryCreate (
|
||||
ltFEE_SETTINGS, Ledger::getLedgerFeeIndex ());
|
||||
|
||||
m_journal.trace <<
|
||||
m_journal.trace <<
|
||||
"Previous fee object: " << feeObject->getJson (0);
|
||||
|
||||
feeObject->setFieldU64 (
|
||||
@@ -162,7 +162,7 @@ private:
|
||||
|
||||
mEngine->entryModify (feeObject);
|
||||
|
||||
m_journal.trace <<
|
||||
m_journal.trace <<
|
||||
"New fee object: " << feeObject->getJson (0);
|
||||
m_journal.warning << "Fees have been changed";
|
||||
return tesSUCCESS;
|
||||
|
||||
@@ -588,7 +588,7 @@ transact_CreateOffer (
|
||||
{
|
||||
// Autobridging is performed only when the offer does not involve XRP
|
||||
bool autobridging =
|
||||
! txn.getFieldAmount (sfTakerPays).isNative() &&
|
||||
! txn.getFieldAmount (sfTakerPays).isNative() &&
|
||||
! txn.getFieldAmount (sfTakerGets).isNative ();
|
||||
|
||||
return CreateOffer (autobridging, txn, params, engine).apply ();
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace ripple {
|
||||
|
||||
// See https://ripple.com/wiki/Transaction_Format#Payment_.280.29
|
||||
|
||||
class Payment
|
||||
class Payment
|
||||
: public Transactor
|
||||
{
|
||||
/* The largest number of paths we allow */
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
bool const bHigh = mTxnAccountID > uDstAccountID;
|
||||
|
||||
std::uint32_t const uOwnerCount (mTxnAccount->getFieldU32 (sfOwnerCount));
|
||||
|
||||
|
||||
// The reserve required to create the line. Note that we allow up to
|
||||
// two trust lines without requiring a reserve because being able to
|
||||
// exchange currencies is a powerful Ripple feature.
|
||||
|
||||
@@ -250,7 +250,7 @@ TER Transactor::preCheck ()
|
||||
// Consistency: really signed.
|
||||
if (!mTxn.isKnownGood ())
|
||||
{
|
||||
if (mTxn.isKnownBad () ||
|
||||
if (mTxn.isKnownBad () ||
|
||||
(!(mParams & tapNO_CHECK_SIGN) && !mTxn.checkSign (mSigningPubKey)))
|
||||
{
|
||||
mTxn.setBad ();
|
||||
|
||||
@@ -94,7 +94,7 @@ private:
|
||||
WriteLog (lsWARNING, WSDoor) << "websocketpp exception: " << e.what ();
|
||||
|
||||
// temporary workaround for websocketpp throwing exceptions on access/close races
|
||||
for (;;)
|
||||
for (;;)
|
||||
{
|
||||
// https://github.com/zaphoyd/websocketpp/issues/98
|
||||
try
|
||||
@@ -140,7 +140,7 @@ private:
|
||||
private:
|
||||
typedef RippleRecursiveMutex LockType;
|
||||
typedef std::lock_guard <LockType> ScopedLockType;
|
||||
|
||||
|
||||
Resource::Manager& m_resourceManager;
|
||||
InfoSub::Source& m_source;
|
||||
boost::asio::ssl::context& m_ssl_context;
|
||||
|
||||
@@ -128,7 +128,7 @@ private:
|
||||
{
|
||||
write (str.c_str ());
|
||||
}
|
||||
|
||||
|
||||
void writeln (std::string const& str)
|
||||
{
|
||||
writeln (str.c_str ());
|
||||
@@ -150,7 +150,7 @@ public:
|
||||
|
||||
Logs (Logs const&) = delete;
|
||||
Logs& operator= (Logs const&) = delete;
|
||||
|
||||
|
||||
bool
|
||||
open (boost::filesystem::path const& pathToLogFile);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <beast/module/core/diagnostic/MeasureFunctionCallTime.h>
|
||||
#include <beast/utility/Debug.h>
|
||||
#include <ripple/basics/SyncUnorderedMap.h>
|
||||
|
||||
|
||||
namespace ripple {
|
||||
|
||||
namespace detail {
|
||||
|
||||
@@ -110,7 +110,7 @@ Logs::Logs()
|
||||
: level_ (beast::Journal::kWarning) // default severity
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Logs::open (boost::filesystem::path const& pathToLogFile)
|
||||
{
|
||||
|
||||
@@ -130,7 +130,7 @@ void RangeSet::setValue (std::uint32_t v)
|
||||
if (!hasValue (v))
|
||||
{
|
||||
mRanges[v] = v;
|
||||
|
||||
|
||||
simplify ();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//==============================================================================
|
||||
|
||||
#include <ripple/basics/ThreadName.h>
|
||||
|
||||
|
||||
// For Sustain Linux variants
|
||||
// VFALCO TODO Rewrite Sustain to use beast::Process
|
||||
#ifdef __linux__
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
{
|
||||
return m_flags == other.m_flags;
|
||||
}
|
||||
|
||||
|
||||
inline bool set (int mask) const noexcept
|
||||
{
|
||||
return (m_flags & mask) == mask;
|
||||
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
// so that we can destroy them outside the lock.
|
||||
//
|
||||
std::vector <mapped_ptr> stuffToSweep;
|
||||
|
||||
|
||||
{
|
||||
clock_type::time_point const now (m_clock.now());
|
||||
clock_type::time_point when_expire;
|
||||
@@ -448,7 +448,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
// Couldn't get strong pointer,
|
||||
// Couldn't get strong pointer,
|
||||
// object fell out of the cache so remove the entry.
|
||||
m_cache.erase (cit);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
|
||||
typedef std::string Key;
|
||||
typedef KeyCache <Key> Cache;
|
||||
|
||||
|
||||
// Insert an item, retrieve it, and age it so it gets purged.
|
||||
{
|
||||
Cache c ("test", clock, 1, 2);
|
||||
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
return beast::IP::Endpoint();
|
||||
}
|
||||
|
||||
try
|
||||
try
|
||||
{
|
||||
return beast::IPAddressConversion::from_asio (
|
||||
m_next_layer.remote_endpoint());
|
||||
@@ -300,7 +300,7 @@ protected:
|
||||
*/
|
||||
bool needs_handshake () override
|
||||
{
|
||||
return m_state == stateHandshake ||
|
||||
return m_state == stateHandshake ||
|
||||
m_state == stateHandshakeFinal ||
|
||||
m_needsShutdown;
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public:
|
||||
// Attempt to find the first and last non-whitespace
|
||||
auto const find_whitespace = std::bind (
|
||||
&std::isspace <std::string::value_type>,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_1,
|
||||
std::locale ());
|
||||
|
||||
auto host_first = std::find_if_not (
|
||||
|
||||
@@ -204,7 +204,7 @@ public:
|
||||
if (! cert_file.empty ())
|
||||
{
|
||||
boost::system::error_code ec;
|
||||
|
||||
|
||||
m_context.use_certificate_file (
|
||||
cert_file, boost::asio::ssl::context::pem, ec);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
typedef int Key;
|
||||
typedef std::string Value;
|
||||
typedef TaggedCache <Key, Value> Cache;
|
||||
|
||||
|
||||
Cache c ("test", 1, 1, clock, j);
|
||||
|
||||
// Insert an item, retrieve it, and age it so it gets purged.
|
||||
|
||||
@@ -171,7 +171,7 @@ public:
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
template <typename Protocol, typename ClientArg, typename ServerArg>
|
||||
void runProxy (ClientArg const& clientArg, ServerArg const& serverArg)
|
||||
{
|
||||
|
||||
@@ -48,12 +48,12 @@ namespace core {
|
||||
|
||||
`X::amount_type`
|
||||
The return type of `in` and `out`
|
||||
|
||||
|
||||
`X a;`
|
||||
Constructs an uninitialized offer
|
||||
|
||||
|
||||
`a.in();`
|
||||
|
||||
|
||||
`a.out();
|
||||
*/
|
||||
|
||||
@@ -424,11 +424,11 @@ public:
|
||||
if (! iter_eq (m_leg1, m_leg1_end,
|
||||
other.m_leg1, other.m_leg1_end))
|
||||
return false;
|
||||
|
||||
|
||||
if (! iter_eq (m_leg2, m_leg2_end,
|
||||
other.m_leg2, other.m_leg2_end))
|
||||
return false;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -498,7 +498,7 @@ public:
|
||||
|
||||
typedef detail::MultiBookIterator <
|
||||
typename Book::iterator> iterator;
|
||||
|
||||
|
||||
typedef detail::MultiBookIterator <
|
||||
typename Book::const_iterator> const_iterator;
|
||||
|
||||
@@ -643,7 +643,7 @@ public:
|
||||
return m_in;
|
||||
}
|
||||
|
||||
Amount const&
|
||||
Amount const&
|
||||
out() const noexcept
|
||||
{
|
||||
return m_out;
|
||||
@@ -805,7 +805,7 @@ public:
|
||||
run()
|
||||
{
|
||||
test_iterators();
|
||||
|
||||
|
||||
test_full_cross_direct ();
|
||||
test_full_cross_auto_direct ();
|
||||
test_full_cross_auto_bridge ();
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
beast::insight::Event dequeue;
|
||||
beast::insight::Event execute;
|
||||
|
||||
explicit JobTypeData (JobTypeInfo const& info_,
|
||||
explicit JobTypeData (JobTypeInfo const& info_,
|
||||
beast::insight::Collector::ptr const& collector) noexcept
|
||||
: m_collector (collector)
|
||||
, info (info_)
|
||||
|
||||
@@ -47,8 +47,8 @@ public:
|
||||
// Not default constructible
|
||||
JobTypeInfo () = delete;
|
||||
|
||||
JobTypeInfo (JobType type, std::string name, int limit,
|
||||
bool skip, bool special, std::uint64_t avgLatency, std::uint64_t peakLatency)
|
||||
JobTypeInfo (JobType type, std::string name, int limit,
|
||||
bool skip, bool special, std::uint64_t avgLatency, std::uint64_t peakLatency)
|
||||
: m_type (type)
|
||||
, m_name (name)
|
||||
, m_limit (limit)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <boost/regex.hpp>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
|
||||
#ifndef DUMP_CONFIG
|
||||
#define DUMP_CONFIG 0
|
||||
#endif
|
||||
@@ -794,7 +794,7 @@ boost::filesystem::path Config::getDebugLogFile () const
|
||||
// decide how to handle this situation.
|
||||
if (ec)
|
||||
{
|
||||
std::cerr <<
|
||||
std::cerr <<
|
||||
"Unable to create log file path " << log_dir <<
|
||||
": " << ec.message() << '\n';
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void LoadMonitor::update ()
|
||||
// do exponential decay
|
||||
/*
|
||||
David:
|
||||
|
||||
|
||||
"Imagine if you add 10 to something every second. And you
|
||||
also reduce it by 1/4 every second. It will "idle" at 40,
|
||||
correponding to 10 counts per second."
|
||||
|
||||
@@ -45,7 +45,7 @@ CBase58Data::~CBase58Data ()
|
||||
|
||||
bool CBase58Data::SetString (
|
||||
std::string const& str,
|
||||
unsigned char version,
|
||||
unsigned char version,
|
||||
Base58::Alphabet const& alphabet)
|
||||
{
|
||||
Blob vchTemp;
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
, signingField (std::move(sf.signingField))
|
||||
, rawJsonName (std::move(sf.rawJsonName))
|
||||
, jsonName (rawJsonName.c_str ())
|
||||
{}
|
||||
{}
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
{
|
||||
return mValue ? (mIsNegative ? -1 : 1) : 0;
|
||||
}
|
||||
|
||||
|
||||
/** Returns a zero value with the same issuer and currency. */
|
||||
STAmount
|
||||
zeroed() const
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
// Operators
|
||||
//
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
explicit operator bool() const noexcept
|
||||
{
|
||||
return *this != zero;
|
||||
@@ -284,7 +284,7 @@ public:
|
||||
|
||||
void
|
||||
add (Serializer& s) const override;
|
||||
|
||||
|
||||
bool
|
||||
isEquivalent (const SerializedType& t) const override;
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
std::string const& value, Issue const& issue, bool success = true)
|
||||
{
|
||||
STAmount amount (issue);
|
||||
|
||||
|
||||
bool const result = amount.setValue (value);
|
||||
|
||||
expect (result == success, "parse " + value);
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
testSetValue ("100000000", usd);
|
||||
testSetValue ("1000000000", usd);
|
||||
testSetValue ("10000000000", usd);
|
||||
|
||||
|
||||
testSetValue ("1234567.1", usd);
|
||||
testSetValue ("1234567.12", usd);
|
||||
testSetValue ("1234567.123", usd);
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
|
||||
virtual
|
||||
Json::Value getJson (int /*options*/) const
|
||||
{
|
||||
|
||||
@@ -89,15 +89,15 @@ void TxFormats::addCommonFields (Item& item)
|
||||
<< SOElement(sfTransactionType, SOE_REQUIRED)
|
||||
<< SOElement(sfFlags, SOE_OPTIONAL)
|
||||
<< SOElement(sfSourceTag, SOE_OPTIONAL)
|
||||
<< SOElement(sfAccount, SOE_REQUIRED)
|
||||
<< SOElement(sfSequence, SOE_REQUIRED)
|
||||
<< SOElement(sfAccount, SOE_REQUIRED)
|
||||
<< SOElement(sfSequence, SOE_REQUIRED)
|
||||
<< SOElement(sfPreviousTxnID, SOE_OPTIONAL) // Deprecated: Do not use
|
||||
<< SOElement(sfLastLedgerSequence, SOE_OPTIONAL)
|
||||
<< SOElement(sfAccountTxnID, SOE_OPTIONAL)
|
||||
<< SOElement(sfFee, SOE_REQUIRED)
|
||||
<< SOElement(sfOperationLimit, SOE_OPTIONAL)
|
||||
<< SOElement(sfFee, SOE_REQUIRED)
|
||||
<< SOElement(sfOperationLimit, SOE_OPTIONAL)
|
||||
<< SOElement(sfMemos, SOE_OPTIONAL)
|
||||
<< SOElement(sfSigningPubKey, SOE_REQUIRED)
|
||||
<< SOElement(sfSigningPubKey, SOE_REQUIRED)
|
||||
<< SOElement(sfTxnSignature, SOE_OPTIONAL)
|
||||
;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
{
|
||||
return ScopedStream (*this, manip);
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
ScopedStream
|
||||
operator<< (T const& t)
|
||||
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
accept();
|
||||
|
||||
private:
|
||||
void
|
||||
void
|
||||
do_handshake (boost::asio::yield_context yield);
|
||||
|
||||
void
|
||||
|
||||
@@ -144,12 +144,12 @@ private:
|
||||
ceil_log2 (unsigned long long x);
|
||||
|
||||
static
|
||||
int
|
||||
int
|
||||
compare (Port const& lhs, Port const& rhs);
|
||||
|
||||
void
|
||||
update();
|
||||
|
||||
|
||||
void
|
||||
on_update();
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
std::uint32_t max_uint = std::numeric_limits<std::uint32_t>::max ();
|
||||
std::int32_t max_int = std::numeric_limits<std::int32_t>::max ();
|
||||
std::int32_t min_int = std::numeric_limits<std::int32_t>::min ();
|
||||
|
||||
|
||||
std::uint32_t a_uint = max_uint - 1978;
|
||||
std::int32_t a_large_int = max_int - 1978;
|
||||
std::int32_t a_small_int = min_int + 1978;
|
||||
|
||||
@@ -703,7 +703,7 @@ Reader::decodeNumber ( Token& token )
|
||||
// More tokens left -> input is larger than largest possible return value
|
||||
if (current != token.end_)
|
||||
{
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
"' exceeds the allowable range.", token );
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ Reader::decodeNumber ( Token& token )
|
||||
|
||||
if (value < Value::minInt || value > Value::maxInt)
|
||||
{
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
"' exceeds the allowable range.", token );
|
||||
}
|
||||
|
||||
@@ -723,7 +723,7 @@ Reader::decodeNumber ( Token& token )
|
||||
{
|
||||
if (value > Value::maxUInt)
|
||||
{
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
return addError ( "'" + std::string ( token.start_, token.end_ ) +
|
||||
"' exceeds the allowable range.", token );
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
*/
|
||||
virtual void store (NodeObject::Ptr const& object) = 0;
|
||||
|
||||
/** Store a group of objects.
|
||||
/** Store a group of objects.
|
||||
@note This function will not be called concurrently with
|
||||
itself or @ref store.
|
||||
*/
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
`nullptr` is returned.
|
||||
|
||||
@note This can be called concurrently.
|
||||
@param hash The key of the object to retrieve.
|
||||
@param hash The key of the object to retrieve.
|
||||
@return The object, or nullptr if it couldn't be retrieved.
|
||||
*/
|
||||
virtual NodeObject::pointer fetch (uint256 const& hash) = 0;
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
variable is overwritten.
|
||||
@param hash The 256-bit hash of the payload data.
|
||||
|
||||
@return `true` if the object was stored?
|
||||
@return `true` if the object was stored?
|
||||
*/
|
||||
virtual void store (NodeObjectType type,
|
||||
std::uint32_t ledgerIndex,
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
virtual float getCacheHitRate () = 0;
|
||||
|
||||
/** Set the maximum number of entries and maximum cache age for both caches.
|
||||
|
||||
|
||||
@param size Number of cache entries (0 = ignore)
|
||||
@param age Maximum cache age in seconds
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
The parameters are key value pairs passed to the backend. The
|
||||
'type' key must exist, it defines the choice of backend. Most
|
||||
backends also require a 'path' field.
|
||||
|
||||
|
||||
Some choices for 'type' are:
|
||||
HyperLevelDB, LevelDBFactory, SQLite, MDB
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ enum NodeObjectType
|
||||
hotTRANSACTION_NODE = 4
|
||||
};
|
||||
|
||||
/** A simple object that the Ledger uses to store entries.
|
||||
NodeObjects are comprised of a type, a hash, a ledger index and a blob.
|
||||
They can be uniquely identified by the hash, which is a SHA 256 of the
|
||||
blob. The blob is a variable length block of serialized data. The type
|
||||
/** A simple object that the Ledger uses to store entries.
|
||||
NodeObjects are comprised of a type, a hash, a ledger index and a blob.
|
||||
They can be uniquely identified by the hash, which is a SHA 256 of the
|
||||
blob. The blob is a variable length block of serialized data. The type
|
||||
identifies what the blob contains.
|
||||
|
||||
@note No checking is performed to make sure the hash matches the data.
|
||||
|
||||
@@ -42,7 +42,7 @@ struct BatchWriteReport
|
||||
};
|
||||
|
||||
/** Scheduling for asynchronous backend activity
|
||||
|
||||
|
||||
For improved performance, a backend has the option of performing writes
|
||||
in batches. These writes can be scheduled using the provided scheduler
|
||||
object.
|
||||
|
||||
@@ -260,7 +260,7 @@ public:
|
||||
return "LevelDB";
|
||||
}
|
||||
|
||||
std::unique_ptr <Backend>
|
||||
std::unique_ptr <Backend>
|
||||
createInstance(
|
||||
size_t keyBytes,
|
||||
Parameters const& keyValues,
|
||||
|
||||
@@ -37,17 +37,17 @@ public:
|
||||
return std::string ();
|
||||
}
|
||||
|
||||
Status
|
||||
Status
|
||||
fetch (void const*, NodeObject::Ptr*)
|
||||
{
|
||||
return notFound;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
store (NodeObject::ref object)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
storeBatch (Batch const& batch)
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
void (*f)(void*);
|
||||
void* a;
|
||||
};
|
||||
|
||||
|
||||
static
|
||||
void
|
||||
thread_entry (void* ptr)
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
std::string
|
||||
std::string
|
||||
getName()
|
||||
{
|
||||
return m_name;
|
||||
@@ -363,7 +363,7 @@ public:
|
||||
return "RocksDB";
|
||||
}
|
||||
|
||||
std::unique_ptr <Backend>
|
||||
std::unique_ptr <Backend>
|
||||
createInstance (
|
||||
size_t keyBytes,
|
||||
Parameters const& keyValues,
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
~ManagerImp ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
add_factory (std::unique_ptr <Factory> factory)
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace NodeStore {
|
||||
class NodeStoreDatabase_test : public TestBase
|
||||
{
|
||||
public:
|
||||
void testImport (std::string const& destBackendType,
|
||||
void testImport (std::string const& destBackendType,
|
||||
std::string const& srcBackendType, std::int64_t seedValue)
|
||||
{
|
||||
std::unique_ptr <Manager> manager (make_Manager ());
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define RIPPLE_OVERLAY_MESSAGE_H_INCLUDED
|
||||
|
||||
#include "ripple.pb.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace ripple {
|
||||
|
||||
@@ -45,7 +45,7 @@ class PeerDoor;
|
||||
class PeerImp;
|
||||
|
||||
class OverlayImpl : public Overlay
|
||||
{
|
||||
{
|
||||
private:
|
||||
using clock_type = std::chrono::steady_clock;
|
||||
using socket_type = boost::asio::ip::tcp::socket;
|
||||
@@ -146,10 +146,10 @@ public:
|
||||
|
||||
void
|
||||
check_stopped ();
|
||||
|
||||
|
||||
void
|
||||
release ();
|
||||
|
||||
|
||||
void
|
||||
remove (PeerFinder::Slot::ptr const& slot);
|
||||
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
onStart () override;
|
||||
|
||||
/** Close all peer connections.
|
||||
If `graceful` is true then active
|
||||
If `graceful` is true then active
|
||||
Requirements:
|
||||
Caller must hold the mutex.
|
||||
*/
|
||||
|
||||
@@ -296,7 +296,7 @@ PeerImp::hasRange (std::uint32_t uMin, std::uint32_t uMax)
|
||||
3. Send HTTP request
|
||||
4. Receive HTTP response
|
||||
5. Enter protocol loop
|
||||
*/
|
||||
*/
|
||||
|
||||
void PeerImp::do_connect ()
|
||||
{
|
||||
@@ -396,7 +396,7 @@ PeerImp::on_connect_ssl (error_code ec)
|
||||
|
||||
#if RIPPLE_STRUCTURED_OVERLAY_CLIENT
|
||||
beast::http::message req (make_request());
|
||||
beast::http::write (write_buffer_, req);
|
||||
beast::http::write (write_buffer_, req);
|
||||
on_write_http_request (error_code(), 0);
|
||||
|
||||
#else
|
||||
@@ -567,7 +567,7 @@ PeerImp::on_read_http_detect (error_code ec, std::size_t bytes_transferred)
|
||||
read_buffer_.commit (bytes_transferred);
|
||||
peer_protocol_detector detector;
|
||||
boost::tribool const is_peer_protocol (detector (read_buffer_.data()));
|
||||
|
||||
|
||||
if (is_peer_protocol)
|
||||
{
|
||||
do_protocol_start();
|
||||
@@ -615,7 +615,7 @@ PeerImp::on_read_http_request (error_code ec, std::size_t bytes_transferred)
|
||||
if (http_message_->upgrade())
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss <<
|
||||
ss <<
|
||||
"HTTP/1.1 200 OK\r\n"
|
||||
"Server: " << BuildInfo::getFullVersionString() << "\r\n"
|
||||
"Upgrade: Ripple/1.2\r\n"
|
||||
@@ -627,7 +627,7 @@ PeerImp::on_read_http_request (error_code ec, std::size_t bytes_transferred)
|
||||
else
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss <<
|
||||
ss <<
|
||||
"HTTP/1.1 400 Bad Request\r\n"
|
||||
"Server: " << BuildInfo::getFullVersionString() << "\r\n"
|
||||
"\r\n"
|
||||
@@ -1284,8 +1284,8 @@ PeerImp::on_message (std::shared_ptr <protocol::TMTransaction> const& m)
|
||||
// For now, be paranoid and have each validator
|
||||
// check each transaction, regardless of source
|
||||
flags |= SF_SIGGOOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getApp().getJobQueue().getJobCount(jtTRANSACTION) > 100)
|
||||
journal_.info << "Transaction queue is full";
|
||||
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
|
||||
State state_; // Current state
|
||||
bool detaching_ = false;
|
||||
|
||||
|
||||
// True if peer is a node in our cluster
|
||||
bool clusterNode_ = false;
|
||||
|
||||
@@ -175,7 +175,7 @@ private:
|
||||
message_stream message_stream_;
|
||||
|
||||
boost::asio::streambuf write_buffer_;
|
||||
|
||||
|
||||
std::unique_ptr <LoadEvent> load_event_;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
|
||||
Peer::ShortId
|
||||
getShortId () const override;
|
||||
|
||||
|
||||
RippleAddress const&
|
||||
getNodePublic () const override;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ struct Config
|
||||
|
||||
/** The set of features we advertise. */
|
||||
std::string features;
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/** Create a configuration with default values. */
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <utility>
|
||||
|
||||
|
||||
namespace ripple {
|
||||
namespace PeerFinder {
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ private:
|
||||
|
||||
/** Active outbound slots. */
|
||||
std::size_t m_out_active;
|
||||
|
||||
|
||||
/** Fixed connections. */
|
||||
std::size_t m_fixed;
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ ConnectHandouts::try_insert (beast::IP::Endpoint const& endpoint)
|
||||
endpoint.address()));
|
||||
if (! result.second)
|
||||
return false;
|
||||
|
||||
|
||||
m_list.push_back (endpoint);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -167,7 +167,7 @@ protected:
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** The Livecache holds the short-lived relayed Endpoint messages.
|
||||
|
||||
|
||||
Since peers only advertise themselves when they have open slots,
|
||||
we want these messags to expire rather quickly after the peer becomes
|
||||
full.
|
||||
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
// Set to indicate that a connection check for this peer is in
|
||||
// progress. Valid always.
|
||||
bool connectivityCheckInProgress;
|
||||
|
||||
|
||||
// The time after which we will accept mtENDPOINTS from the peer
|
||||
// This is to prevent flooding or spamming. Receipt of mtENDPOINTS
|
||||
// sooner than the allotted time should impose a load charge.
|
||||
|
||||
@@ -38,7 +38,7 @@ void breadth_first_traverse (Vertex& start, Function f)
|
||||
typedef VertexTraits <Vertex> Traits;
|
||||
typedef typename Traits::Edges Edges;
|
||||
typedef typename Traits::Edge Edge;
|
||||
|
||||
|
||||
typedef std::pair <Vertex*, int> Probe;
|
||||
typedef std::deque <Probe> Work;
|
||||
typedef std::set <Vertex*> Visited;
|
||||
@@ -73,4 +73,4 @@ void breadth_first_traverse (Vertex& start, Function f)
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
Node const& remote_node () const { return *m_remote_node; }
|
||||
Node& local_node () { return *m_local_node; }
|
||||
Node const& local_node () const { return *m_local_node; }
|
||||
|
||||
|
||||
void post (Message const& m)
|
||||
{
|
||||
m_pending.push_back (m);
|
||||
@@ -164,7 +164,7 @@ public:
|
||||
: canAccept (true)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool canAccept;
|
||||
IP::Endpoint listening_endpoint;
|
||||
IP::Endpoint well_known_endpoint;
|
||||
@@ -829,7 +829,7 @@ void report_crawls (Stream const& stream, CrawlSequence const& c)
|
||||
{
|
||||
if (! stream)
|
||||
return;
|
||||
stream
|
||||
stream
|
||||
<< "Crawl Report"
|
||||
<< std::endl
|
||||
<< std::setw (6) << "Step"
|
||||
@@ -957,7 +957,7 @@ void report_node_timeline (Node const& node, Stream const& stream)
|
||||
field (sequence_to_string (t.begin (), t.end(), " ", 2), histw) <<
|
||||
fpad (2)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -1038,7 +1038,7 @@ public:
|
||||
"Time " << n.now ().time_since_epoch () << std::endl <<
|
||||
divider ()
|
||||
;
|
||||
|
||||
|
||||
n.step();
|
||||
n.journal().info << std::endl;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
default:
|
||||
case Journal::kFatal: s += "Fatal: "; break;
|
||||
};
|
||||
|
||||
|
||||
s+= text;
|
||||
m_sink.write (level, s);
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ Charge legacyFee (LoadType t)
|
||||
case LT_NeededData: return feeSatisfiedRequest;
|
||||
|
||||
case LT_RequestData: return feeRequestedData;
|
||||
|
||||
|
||||
default:
|
||||
bassertfalse;
|
||||
case LT_CheapQuery: return feeCheapQuery;
|
||||
|
||||
@@ -136,7 +136,7 @@ Json::Value doAccountLines (RPC::Context& context)
|
||||
limit = RPC::Tuning::defaultLinesPerRequest;
|
||||
}
|
||||
|
||||
Json::Value& jsonLines (result[jss::lines] = Json::arrayValue);
|
||||
Json::Value& jsonLines (result[jss::lines] = Json::arrayValue);
|
||||
Account const& raAccount(rippleAddress.getAccountID ());
|
||||
VisitData visitData = { {}, raAccount, rippleAddressPeer, raPeerAccount };
|
||||
unsigned int reserve (limit);
|
||||
@@ -146,7 +146,7 @@ Json::Value doAccountLines (RPC::Context& context)
|
||||
if (params.isMember (jss::marker))
|
||||
{
|
||||
// We have a start point. Use limit - 1 from the result and use the
|
||||
// very last one for the resume.
|
||||
// very last one for the resume.
|
||||
Json::Value const& marker (params[jss::marker]);
|
||||
|
||||
if (! marker.isString ())
|
||||
@@ -157,7 +157,7 @@ Json::Value doAccountLines (RPC::Context& context)
|
||||
|
||||
if (sleLine == nullptr || sleLine->getType () != ltRIPPLE_STATE)
|
||||
return rpcError (rpcINVALID_PARAMS);
|
||||
|
||||
|
||||
if (sleLine->getFieldAmount (sfLowLimit).getIssuer () == raAccount)
|
||||
startHint = sleLine->getFieldU64 (sfLowNode);
|
||||
else if (sleLine->getFieldAmount (sfHighLimit).getIssuer () == raAccount)
|
||||
@@ -197,7 +197,7 @@ Json::Value doAccountLines (RPC::Context& context)
|
||||
{
|
||||
return rpcError (rpcINVALID_PARAMS);
|
||||
}
|
||||
|
||||
|
||||
if (visitData.items.size () == reserve)
|
||||
{
|
||||
result[jss::limit] = limit;
|
||||
|
||||
@@ -74,9 +74,9 @@ Json::Value doAccountOffers (RPC::Context& context)
|
||||
{
|
||||
limit = RPC::Tuning::defaultOffersPerRequest;
|
||||
}
|
||||
|
||||
|
||||
Account const& raAccount (rippleAddress.getAccountID ());
|
||||
Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue);
|
||||
Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue);
|
||||
std::vector <SLE::pointer> offers;
|
||||
unsigned int reserve (limit);
|
||||
uint256 startAfter;
|
||||
@@ -85,7 +85,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
||||
if (params.isMember(jss::marker))
|
||||
{
|
||||
// We have a start point. Use limit - 1 from the result and use the
|
||||
// very last one for the resume.
|
||||
// very last one for the resume.
|
||||
Json::Value const& marker (params[jss::marker]);
|
||||
|
||||
if (! marker.isString ())
|
||||
@@ -108,14 +108,14 @@ Json::Value doAccountOffers (RPC::Context& context)
|
||||
sleOffer->getFieldAmount (sfTakerPays).setJson (obj[jss::taker_pays]);
|
||||
sleOffer->getFieldAmount (sfTakerGets).setJson (obj[jss::taker_gets]);
|
||||
obj[jss::seq] = sleOffer->getFieldU32 (sfSequence);
|
||||
obj[jss::flags] = sleOffer->getFieldU32 (sfFlags);
|
||||
obj[jss::flags] = sleOffer->getFieldU32 (sfFlags);
|
||||
|
||||
offers.reserve (reserve);
|
||||
}
|
||||
else
|
||||
{
|
||||
startHint = 0;
|
||||
// We have no start point, limit should be one higher than requested.
|
||||
// We have no start point, limit should be one higher than requested.
|
||||
offers.reserve (++reserve);
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
||||
{
|
||||
result[jss::limit] = limit;
|
||||
|
||||
result[jss::marker] = to_string (offers.back ()->getIndex ());
|
||||
result[jss::marker] = to_string (offers.back ()->getIndex ());
|
||||
offers.pop_back ();
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ Json::Value doAccountOffers (RPC::Context& context)
|
||||
offer->getFieldAmount (sfTakerPays).setJson (obj[jss::taker_pays]);
|
||||
offer->getFieldAmount (sfTakerGets).setJson (obj[jss::taker_gets]);
|
||||
obj[jss::seq] = offer->getFieldU32 (sfSequence);
|
||||
obj[jss::flags] = offer->getFieldU32 (sfFlags);
|
||||
obj[jss::flags] = offer->getFieldU32 (sfFlags);
|
||||
}
|
||||
|
||||
context.loadType_ = Resource::feeMediumBurdenRPC;
|
||||
|
||||
@@ -85,7 +85,7 @@ Json::Value doGetCounts (RPC::Context& context)
|
||||
textTime (uptime, s, "minute", 60);
|
||||
textTime (uptime, s, "second", 1);
|
||||
ret["uptime"] = uptime;
|
||||
|
||||
|
||||
ret["node_writes"] = app.getNodeStore().getStoreCount();
|
||||
ret["node_reads_total"] = app.getNodeStore().getFetchTotalCount();
|
||||
ret["node_reads_hit"] = app.getNodeStore().getFetchHitCount();
|
||||
|
||||
@@ -66,7 +66,7 @@ int const maxRequestSize (1000000);
|
||||
|
||||
} // Tuning
|
||||
/** @} */
|
||||
|
||||
|
||||
} // RPC
|
||||
} // ripple
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace detail {
|
||||
{
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
operator BIGNUM const* () const
|
||||
{
|
||||
return num;
|
||||
@@ -94,9 +94,9 @@ namespace detail {
|
||||
// The format is: <02> <length of signature> <signature>
|
||||
if ((sig[0] != 0x02) || (size < 3))
|
||||
return;
|
||||
|
||||
|
||||
size_t const len (sig[1]);
|
||||
|
||||
|
||||
// Claimed length can't be longer than amount of data available
|
||||
if (len > (size - 2))
|
||||
return;
|
||||
@@ -133,7 +133,7 @@ namespace detail {
|
||||
{
|
||||
return m_bn;
|
||||
}
|
||||
|
||||
|
||||
// Returns the number of bytes to skip for this signature part
|
||||
size_t skip () const
|
||||
{
|
||||
@@ -148,11 +148,11 @@ namespace detail {
|
||||
|
||||
/** Determine whether a signature is canonical.
|
||||
Canonical signatures are important to protect against signature morphing
|
||||
attacks.
|
||||
attacks.
|
||||
@param vSig the signature data
|
||||
@param sigLen the length of the signature
|
||||
@param strict_param whether to enforce strictly canonical semantics
|
||||
|
||||
|
||||
@note For more details please see:
|
||||
https://ripple.com/wiki/Transaction_Malleability
|
||||
https://bitcointalk.org/index.php?topic=8392.msg127623#msg127623
|
||||
@@ -170,27 +170,27 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param)
|
||||
|
||||
if ((sig[0] != 0x30) || (sig[1] != (sigLen - 2)))
|
||||
return false;
|
||||
|
||||
|
||||
// The first two bytes are verified. Eat them.
|
||||
sig += 2;
|
||||
sigLen -= 2;
|
||||
|
||||
// Verify the R signature
|
||||
detail::SignaturePart sigR (sig, sigLen);
|
||||
|
||||
|
||||
if (!sigR.valid ())
|
||||
return false;
|
||||
|
||||
// Eat the number of bytes we consumed
|
||||
sig += sigR.skip ();
|
||||
sigLen -= sigR.skip ();
|
||||
|
||||
|
||||
// Verify the S signature
|
||||
detail::SignaturePart sigS (sig, sigLen);
|
||||
|
||||
|
||||
if (!sigS.valid ())
|
||||
return false;
|
||||
|
||||
|
||||
// Eat the number of bytes we consumed
|
||||
sig += sigS.skip ();
|
||||
sigLen -= sigS.skip ();
|
||||
@@ -207,7 +207,7 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param)
|
||||
return false;
|
||||
|
||||
if (BN_cmp (bnS, detail::modulus) != -1)
|
||||
return false;
|
||||
return false;
|
||||
|
||||
// For a given signature, (R,S), the signature (R, N-S) is also valid. For
|
||||
// a signature to be fully-canonical, the smaller of these two values must
|
||||
@@ -228,7 +228,7 @@ bool isCanonicalECDSASig (void const* vSig, size_t sigLen, ECDSA strict_param)
|
||||
|
||||
/** Convert a signature into strictly canonical form.
|
||||
Given the signature (R, S) then (R, G-S) is also valid. For a signature
|
||||
to be canonical, the smaller of { S, G-S } must be specified.
|
||||
to be canonical, the smaller of { S, G-S } must be specified.
|
||||
@param vSig the signature we wish to convert
|
||||
@param sigLen the length of the signature
|
||||
@returns true if the signature was already canonical, false otherwise
|
||||
@@ -340,12 +340,12 @@ public:
|
||||
"022100FF478110D1D4294471EC76E0157540C2181F47DEBD25D7F9E7DDCCCD47EEE905"
|
||||
"0220078F07CDAE6C240855D084AD91D1479609533C147C93B0AEF19BC9724D003F28"),
|
||||
"Strictly canonical signature");
|
||||
|
||||
|
||||
expect (isStrictlyCanonical("3045"
|
||||
"0221009218248292F1762D8A51BE80F8A7F2CD288D810CE781D5955700DA1684DF1D2D"
|
||||
"022041A1EE1746BFD72C9760CC93A7AAA8047D52C8833A03A20EAAE92EA19717B454"),
|
||||
"Strictly canonical signature");
|
||||
|
||||
|
||||
expect (isStrictlyCanonical("3044"
|
||||
"02206A9E43775F73B6D1EC420E4DDD222A80D4C6DF5D1BEECC431A91B63C928B7581"
|
||||
"022023E9CC2D61DDA6F73EAA6BCB12688BEB0F434769276B3127E4044ED895C9D96B"),
|
||||
@@ -389,8 +389,8 @@ public:
|
||||
testcase ("Canonical signature checks", abort_on_fail);
|
||||
|
||||
// r and s 1 byte 1
|
||||
expect (isValid ("3006"
|
||||
"020101"
|
||||
expect (isValid ("3006"
|
||||
"020101"
|
||||
"020102"),
|
||||
"Well-formed short signature");
|
||||
|
||||
@@ -413,12 +413,12 @@ public:
|
||||
"022100FF478110D1D4294471EC76E0157540C2181F47DEBD25D7F9E7DDCCCD47EEE905"
|
||||
"0220078F07CDAE6C240855D084AD91D1479609533C147C93B0AEF19BC9724D003F28"),
|
||||
"Canonical signature");
|
||||
|
||||
|
||||
expect (isStrictlyCanonical("3045"
|
||||
"0221009218248292F1762D8A51BE80F8A7F2CD288D810CE781D5955700DA1684DF1D2D"
|
||||
"022041A1EE1746BFD72C9760CC93A7AAA8047D52C8833A03A20EAAE92EA19717B454"),
|
||||
"Canonical signature");
|
||||
|
||||
|
||||
expect (isStrictlyCanonical("3044"
|
||||
"02206A9E43775F73B6D1EC420E4DDD222A80D4C6DF5D1BEECC431A91B63C928B7581"
|
||||
"022023E9CC2D61DDA6F73EAA6BCB12688BEB0F434769276B3127E4044ED895C9D96B"),
|
||||
@@ -445,38 +445,38 @@ public:
|
||||
"0200"),
|
||||
"tooshort");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020101"
|
||||
expect (!isValid ("3006"
|
||||
"020101"
|
||||
"020202"),
|
||||
"Slen-Overlong");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020701"
|
||||
expect (!isValid ("3006"
|
||||
"020701"
|
||||
"020102"),
|
||||
"Rlen-Overlong-OOB");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020401"
|
||||
expect (!isValid ("3006"
|
||||
"020401"
|
||||
"020102"),
|
||||
"Rlen-Overlong-OOB");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020501"
|
||||
expect (!isValid ("3006"
|
||||
"020501"
|
||||
"020102"),
|
||||
"Rlen-Overlong-OOB");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020201"
|
||||
expect (!isValid ("3006"
|
||||
"020201"
|
||||
"020102"),
|
||||
"Rlen-Overlong");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020301"
|
||||
expect (!isValid ("3006"
|
||||
"020301"
|
||||
"020202"),
|
||||
"Rlen Overlong and Slen-Overlong");
|
||||
|
||||
expect (!isValid ("3006"
|
||||
"020401"
|
||||
expect (!isValid ("3006"
|
||||
"020401"
|
||||
"020202"),
|
||||
"Rlen Overlong and OOB and Slen-Overlong");
|
||||
|
||||
@@ -554,7 +554,7 @@ public:
|
||||
|
||||
size_t len = b.size ();
|
||||
|
||||
expect (!makeCanonicalECDSASig (&b[0], len),
|
||||
expect (!makeCanonicalECDSASig (&b[0], len),
|
||||
"non-canonical signature was already canonical");
|
||||
|
||||
expect (b.size () >= len,
|
||||
@@ -602,7 +602,7 @@ public:
|
||||
"3045"
|
||||
"02210099DCA1188663DDEA506A06A7B20C2B7D8C26AFF41DECE69D6C5F7C967D32625F"
|
||||
"02207689A7594E06111A2EBF285CCD25F4277EF55371C4F4AA1BA4D09CD73B43BA57");
|
||||
|
||||
|
||||
convertNonCanonical (
|
||||
"3045"
|
||||
"02200855DE366E4E323AA2CE2A25674401A7D11F72EC432770D07F7B57DF7387AEC0"
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace ripple {
|
||||
|
||||
@tparam Size The number of bytes in the identifier, exclusive of version,
|
||||
checksum, or padding.
|
||||
|
||||
|
||||
@tparam Token A byte prepended to the binary data that distinguishes
|
||||
the type of identifier.
|
||||
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
template <std::size_t Size, std::uint8_t Token, bool Checked>
|
||||
template <std::size_t Size, std::uint8_t Token, bool Checked>
|
||||
typename CryptoIdentifier <Size, Token, Checked>::size_type
|
||||
const CryptoIdentifier <Size, Token, Checked>::size;
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
{
|
||||
return lhs == rhs;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
// iterator access
|
||||
iterator begin() { return &m_storage[pre_size]; }
|
||||
|
||||
@@ -28,7 +28,7 @@ char charHex (int iDigit)
|
||||
if(iDigit < 16)
|
||||
return 'A' - 10 + iDigit;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ int charUnHex (char cDigit)
|
||||
};
|
||||
|
||||
static HexTab xtab;
|
||||
|
||||
|
||||
return xtab[cDigit];
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
namespace ripple {
|
||||
|
||||
/** Converts an integer to the corresponding hex digit
|
||||
/** Converts an integer to the corresponding hex digit
|
||||
@param iDigit 0-15 inclusive
|
||||
@return a character from '0'-'9' or 'A'-'F' on success; 0 on failure.
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
~SourceFileImp ()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
std::string to_string () const
|
||||
{
|
||||
std::stringstream ss;
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
{
|
||||
return m_file.getFullPathName ().toStdString();
|
||||
}
|
||||
|
||||
|
||||
void fetch (Results& results, beast::Journal journal)
|
||||
{
|
||||
std::int64_t const fileSize (m_file.getSize ());
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
information filled in from the Store.
|
||||
*/
|
||||
virtual void insert (SourceDesc& desc) = 0;
|
||||
|
||||
|
||||
/** Update the SourceDesc fixed fields. */
|
||||
virtual void update (SourceDesc& desc, bool updateFetchResults = false) = 0;
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ bool StoreSqdb::select (SourceDesc& desc)
|
||||
{
|
||||
m_journal.debug <<
|
||||
"Found record for " << *desc.source;
|
||||
|
||||
|
||||
found = true;
|
||||
desc.lastFetchTime = stringToTime (lastFetchTime);
|
||||
desc.expirationTime = stringToTime (expirationTime);
|
||||
@@ -311,7 +311,7 @@ bool StoreSqdb::select (SourceDesc& desc)
|
||||
void StoreSqdb::selectList (SourceDesc& desc)
|
||||
{
|
||||
beast::Error error;
|
||||
|
||||
|
||||
std::string const sourceID (desc.source->uniqueID());
|
||||
|
||||
// Get the count
|
||||
|
||||
Reference in New Issue
Block a user