mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Emergency fix. boost::format doesn't have the thread safety we thought.
This commit is contained in:
@@ -1154,19 +1154,19 @@ std::string STAmount::getFullText() const
|
|||||||
static boost::format normal("%s/%s/%s");
|
static boost::format normal("%s/%s/%s");
|
||||||
if (mIsNative)
|
if (mIsNative)
|
||||||
{
|
{
|
||||||
return str(nativeFormat % getText());
|
return str(boost::format(nativeFormat) % getText());
|
||||||
}
|
}
|
||||||
else if (!mIssuer)
|
else if (!mIssuer)
|
||||||
{
|
{
|
||||||
return str(noIssuer % getText() % getHumanCurrency());
|
return str(boost::format(noIssuer) % getText() % getHumanCurrency());
|
||||||
}
|
}
|
||||||
else if (mIssuer == ACCOUNT_ONE)
|
else if (mIssuer == ACCOUNT_ONE)
|
||||||
{
|
{
|
||||||
return str(issuerOne % getText() % getHumanCurrency());
|
return str(boost::format(issuerOne) % getText() % getHumanCurrency());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return str(normal
|
return str(boost::format(normal)
|
||||||
% getText()
|
% getText()
|
||||||
% getHumanCurrency()
|
% getHumanCurrency()
|
||||||
% RippleAddress::createHumanAccountID(mIssuer));
|
% RippleAddress::createHumanAccountID(mIssuer));
|
||||||
|
|||||||
@@ -154,7 +154,8 @@ void HashedObjectStore::bulkWrite()
|
|||||||
case hotTRANSACTION_NODE: type = 'N'; break;
|
case hotTRANSACTION_NODE: type = 'N'; break;
|
||||||
default: type = 'U';
|
default: type = 'U';
|
||||||
}
|
}
|
||||||
db->executeSQL(boost::str(fAdd % it->getHash().GetHex() % type % it->getIndex() % sqlEscape(it->getData())));
|
db->executeSQL(boost::str(boost::format(fAdd)
|
||||||
|
% it->getHash().GetHex() % type % it->getIndex() % sqlEscape(it->getData())));
|
||||||
}
|
}
|
||||||
|
|
||||||
db->executeSQL("END TRANSACTION;");
|
db->executeSQL("END TRANSACTION;");
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ ProofOfWork ProofOfWorkGenerator::getProof()
|
|||||||
|
|
||||||
boost::mutex::scoped_lock sl(mLock);
|
boost::mutex::scoped_lock sl(mLock);
|
||||||
|
|
||||||
std::string s = boost::str(f % challenge.GetHex() % mTarget.GetHex() % mIterations % now);
|
std::string s = boost::str(boost::format(f) % challenge.GetHex() % mTarget.GetHex() % mIterations % now);
|
||||||
std::string c = mSecret.GetHex() + s;
|
std::string c = mSecret.GetHex() + s;
|
||||||
s += "-" + Serializer::getSHA512Half(c).GetHex();
|
s += "-" + Serializer::getSHA512Half(c).GetHex();
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ std::string SHAMapNode::getString() const
|
|||||||
if ((mDepth == 0) && (mNodeID.isZero()))
|
if ((mDepth == 0) && (mNodeID.isZero()))
|
||||||
return "NodeID(root)";
|
return "NodeID(root)";
|
||||||
|
|
||||||
return str(NodeID
|
return str(boost::format(NodeID)
|
||||||
% boost::lexical_cast<std::string>(mDepth)
|
% boost::lexical_cast<std::string>(mDepth)
|
||||||
% mNodeID.GetHex());
|
% mNodeID.GetHex());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ std::string SerializedTransaction::getSQL(Serializer rawTxn, uint32 inLedger, ch
|
|||||||
static boost::format bfTrans("('%s', '%s', '%s', '%d', '%d', '%c', %s)");
|
static boost::format bfTrans("('%s', '%s', '%s', '%d', '%d', '%c', %s)");
|
||||||
std::string rTxn = sqlEscape(rawTxn.peekData());
|
std::string rTxn = sqlEscape(rawTxn.peekData());
|
||||||
|
|
||||||
return str(bfTrans
|
return str(boost::format(bfTrans)
|
||||||
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
||||||
% getSequence() % inLedger % status % rTxn);
|
% getSequence() % inLedger % status % rTxn);
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ std::string SerializedTransaction::getMetaSQL(Serializer rawTxn, uint32 inLedger
|
|||||||
static boost::format bfTrans("('%s', '%s', '%s', '%d', '%d', '%c', %s, %s)");
|
static boost::format bfTrans("('%s', '%s', '%s', '%d', '%d', '%c', %s, %s)");
|
||||||
std::string rTxn = sqlEscape(rawTxn.peekData());
|
std::string rTxn = sqlEscape(rawTxn.peekData());
|
||||||
|
|
||||||
return str(bfTrans
|
return str(boost::format(bfTrans)
|
||||||
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
||||||
% getSequence() % inLedger % status % rTxn % escapedMetaData);
|
% getSequence() % inLedger % status % rTxn % escapedMetaData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ void ValidationCollection::condWrite()
|
|||||||
void ValidationCollection::doWrite(Job&)
|
void ValidationCollection::doWrite(Job&)
|
||||||
{
|
{
|
||||||
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtDISK, "ValidationWrite"));
|
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtDISK, "ValidationWrite"));
|
||||||
static boost::format insVal("INSERT INTO Validations "
|
boost::format insVal("INSERT INTO Validations "
|
||||||
"(LedgerHash,NodePubKey,SignTime,RawData) VALUES ('%s','%s','%u',%s);");
|
"(LedgerHash,NodePubKey,SignTime,RawData) VALUES ('%s','%s','%u',%s);");
|
||||||
|
|
||||||
boost::mutex::scoped_lock sl(mValidationLock);
|
boost::mutex::scoped_lock sl(mValidationLock);
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ inline std::string strHex(const uint64 uiHost)
|
|||||||
inline static std::string sqlEscape(const std::string& strSrc)
|
inline static std::string sqlEscape(const std::string& strSrc)
|
||||||
{
|
{
|
||||||
static boost::format f("X'%s'");
|
static boost::format f("X'%s'");
|
||||||
return str(f % strHex(strSrc));
|
return str(boost::format(f) % strHex(strSrc));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static std::string sqlEscape(const std::vector<unsigned char>& vecSrc)
|
inline static std::string sqlEscape(const std::vector<unsigned char>& vecSrc)
|
||||||
|
|||||||
Reference in New Issue
Block a user