mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Manual fixes.
This commit is contained in:
@@ -230,10 +230,6 @@ std::string STAmount::createHumanCurrency(const uint160& uCurrency)
|
||||
{
|
||||
return "1";
|
||||
}
|
||||
else if (CURRENCY_BAD == uCurrency)
|
||||
{
|
||||
return uCurrency.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
Serializer s(160/8);
|
||||
|
||||
@@ -80,8 +80,7 @@ void PeerSet::TimerEntry(boost::weak_ptr<PeerSet> wptr, const boost::system::err
|
||||
cLog(lsDEBUG) << "Deferring PeerSet timer due to load";
|
||||
ptr->setTimer();
|
||||
}
|
||||
else theApp->getJobQueue().addJob(jtLEDGER_DATA, "timerEntry",
|
||||
BIND_TYPE(&PeerSet::TimerJobEntry, P_1, ptr));
|
||||
else theApp->getJobQueue().addJob(jtLEDGER_DATA, "timerEntry", BIND_TYPE(&PeerSet::TimerJobEntry, P_1, ptr));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -306,11 +305,10 @@ bool LedgerAcquire::addOnComplete(FUNCTION_TYPE<void (LedgerAcquire::pointer)> t
|
||||
void LedgerAcquire::trigger(Peer::ref peer)
|
||||
{
|
||||
boost::recursive_mutex::scoped_lock sl(mLock);
|
||||
if (mAborted || mComplete || mFailed)
|
||||
if (isDone())
|
||||
{
|
||||
cLog(lsDEBUG) << "Trigger on ledger:" <<
|
||||
(mAborted ? " aborted": "") << (mComplete ? " completed": "") << (mFailed ? " failed" : "") <<
|
||||
" wc=" << mWaitCount;
|
||||
(mAborted ? " aborted": "") << (mComplete ? " completed": "") << (mFailed ? " failed" : "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -754,7 +754,7 @@ SHAMap::pointer LedgerConsensus::getTransactionTree(const uint256& hash, bool do
|
||||
TransactionAcquire::pointer& acquiring = mAcquiring[hash];
|
||||
if (!acquiring)
|
||||
{
|
||||
if (!hash)
|
||||
if (hash.isZero())
|
||||
{
|
||||
SHAMap::pointer empty = boost::make_shared<SHAMap>(smtTRANSACTION);
|
||||
mapComplete(hash, empty, false);
|
||||
@@ -1336,10 +1336,13 @@ Json::Value LedgerConsensus::getJson(bool full)
|
||||
if (!mAcquired.empty())
|
||||
{ // acquired
|
||||
typedef boost::unordered_map<uint256, SHAMap::pointer>::value_type ac_t;
|
||||
Json::Value acq(Json::arrayValue);
|
||||
Json::Value acq(Json::objectValue);
|
||||
BOOST_FOREACH(ac_t& at, mAcquired)
|
||||
{
|
||||
acq.append(at.first.GetHex());
|
||||
if (at.second)
|
||||
acq[at.first.GetHex()] = "acquired";
|
||||
else
|
||||
acq[at.first.GetHex()] = "failed";
|
||||
}
|
||||
ret["acquired"] = acq;
|
||||
}
|
||||
|
||||
@@ -63,6 +63,11 @@ class Pathfinder
|
||||
|
||||
bool matchesOrigin(const uint160& currency, const uint160& issuer);
|
||||
|
||||
AccountItems& getRippleLines(const uint160& accountID);
|
||||
|
||||
int getPathsOut(const uint160& currency, const uint160& accountID,
|
||||
bool isAuthRequired, bool isDestCurrency, const uint160& dest);
|
||||
|
||||
public:
|
||||
Pathfinder(Ledger::ref ledger,
|
||||
const RippleAddress& srcAccountID, const RippleAddress& dstAccountID,
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
AccountItem::pointer makeItem(const uint160& accountID, SerializedLedgerEntry::ref ledgerEntry);
|
||||
LedgerEntryType getType(){ return(ltRIPPLE_STATE); }
|
||||
|
||||
void setViewAccount(const uint160& accountID);
|
||||
void setViewAccount(const uint160& accountID);
|
||||
|
||||
const uint160& getAccountID() const { return mViewLowest ? mLowID : mHighID; }
|
||||
const uint160& getAccountIDPeer() const { return !mViewLowest ? mLowID : mHighID; }
|
||||
|
||||
@@ -16,7 +16,7 @@ class SHAMapDiffNode
|
||||
SHAMapNode mNodeID;
|
||||
uint256 mOurHash, mOtherHash;
|
||||
|
||||
SHAMapDiffNode(SHAMapNode id, const uint256& ourHash, const uint256& otherHash) :
|
||||
SHAMapDiffNode(const SHAMapNode& id, const uint256& ourHash, const uint256& otherHash) :
|
||||
mNodeID(id), mOurHash(ourHash), mOtherHash(otherHash) { ; }
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ bool SHAMap::walkBranch(SHAMapTreeNode* node, SHAMapItem::ref otherMapItem, bool
|
||||
{
|
||||
SHAMapTreeNode* node = nodeStack.top();
|
||||
nodeStack.pop();
|
||||
if(node->isInner())
|
||||
if (node->isInner())
|
||||
{ // This is an inner node, add all non-empty branches
|
||||
for(int i = 0; i < 16; ++i)
|
||||
if (!node->isEmptyBranch(i))
|
||||
@@ -56,15 +56,16 @@ bool SHAMap::walkBranch(SHAMapTreeNode* node, SHAMapItem::ref otherMapItem, bool
|
||||
emptyBranch = true;
|
||||
}
|
||||
|
||||
if (emptyBranch || (item->getTag() < otherMapItem->getTag()))
|
||||
if (emptyBranch || (item->getTag() != otherMapItem->getTag()))
|
||||
{ // unmatched
|
||||
if (isFirstMap)
|
||||
differences.insert(std::make_pair(item->getTag(), std::make_pair(item, SHAMapItem::pointer())));
|
||||
else
|
||||
differences.insert(std::make_pair(item->getTag(), std::make_pair(SHAMapItem::pointer(), item)));
|
||||
if (--maxCount <= 0) return false;
|
||||
if (--maxCount <= 0)
|
||||
return false;
|
||||
}
|
||||
else if (item->getTag() == otherMapItem->getTag())
|
||||
else
|
||||
{
|
||||
if (item->peekData() != otherMapItem->peekData())
|
||||
{ // non-matching items
|
||||
@@ -72,11 +73,11 @@ bool SHAMap::walkBranch(SHAMapTreeNode* node, SHAMapItem::ref otherMapItem, bool
|
||||
std::make_pair(item, otherMapItem)));
|
||||
else differences.insert(std::make_pair(otherMapItem->getTag(),
|
||||
std::make_pair(otherMapItem, item)));
|
||||
if(--maxCount <= 0) return false;
|
||||
item.reset();
|
||||
if(--maxCount <= 0)
|
||||
return false;
|
||||
}
|
||||
emptyBranch = true;
|
||||
}
|
||||
else assert(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +89,8 @@ bool SHAMap::walkBranch(SHAMapTreeNode* node, SHAMapItem::ref otherMapItem, bool
|
||||
else
|
||||
differences.insert(std::make_pair(otherMapItem->getTag(),
|
||||
std::make_pair(otherMapItem, SHAMapItem::pointer())));
|
||||
if (--maxCount <= 0) return false;
|
||||
if (--maxCount <= 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -160,7 +162,7 @@ bool SHAMap::compare(SHAMap::ref otherMap, SHAMapDiff& differences, int maxCount
|
||||
else if (ourNode->isInner() && otherNode->isInner())
|
||||
{
|
||||
for (int i = 0; i < 16; ++i)
|
||||
if (ourNode->getChildHash(i) != otherNode->getChildHash(i) )
|
||||
if (ourNode->getChildHash(i) != otherNode->getChildHash(i))
|
||||
{
|
||||
if (otherNode->isEmptyBranch(i))
|
||||
{ // We have a branch, the other tree does not
|
||||
|
||||
@@ -122,11 +122,10 @@ std::vector<uint256> SHAMap::getNeededHashes(int max)
|
||||
int branch = (base + ii) % 16;
|
||||
if (!node->isEmptyBranch(branch))
|
||||
{
|
||||
SHAMapNode childID = node->getChildNodeID(branch);
|
||||
const uint256& childHash = node->getChildHash(branch);
|
||||
try
|
||||
{
|
||||
SHAMapTreeNode* d = getNodePointer(childID, childHash);
|
||||
SHAMapTreeNode* d = getNodePointer(node->getChildNodeID(branch), childHash);
|
||||
assert(d);
|
||||
if (d->isInner() && !d->isFullBelow())
|
||||
{
|
||||
|
||||
@@ -39,9 +39,10 @@ static inline const uint160& get_u160_zero() { return u160_zero; }
|
||||
static inline const uint160& get_u160_one() { return u160_one; }
|
||||
|
||||
#define CURRENCY_XRP get_u160_zero()
|
||||
#define CURRENCY_ONE get_u160_one() // Used as a place holder
|
||||
#define CURRENCY_ONE get_u160_one() // Used as a place holder
|
||||
#define CURRENCY_BAD uint160(0x5852500000000000) // Do not allow XRP as an IOU currency.
|
||||
#define ACCOUNT_XRP get_u160_zero()
|
||||
#define ACCOUNT_ONE get_u160_one() // Used as a place holder
|
||||
#define ACCOUNT_ONE get_u160_one() // Used as a place holder
|
||||
|
||||
class SerializedType
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user