mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-26 22:15:52 +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");
|
||||
if (mIsNative)
|
||||
{
|
||||
return str(nativeFormat % getText());
|
||||
return str(boost::format(nativeFormat) % getText());
|
||||
}
|
||||
else if (!mIssuer)
|
||||
{
|
||||
return str(noIssuer % getText() % getHumanCurrency());
|
||||
return str(boost::format(noIssuer) % getText() % getHumanCurrency());
|
||||
}
|
||||
else if (mIssuer == ACCOUNT_ONE)
|
||||
{
|
||||
return str(issuerOne % getText() % getHumanCurrency());
|
||||
return str(boost::format(issuerOne) % getText() % getHumanCurrency());
|
||||
}
|
||||
else
|
||||
{
|
||||
return str(normal
|
||||
return str(boost::format(normal)
|
||||
% getText()
|
||||
% getHumanCurrency()
|
||||
% RippleAddress::createHumanAccountID(mIssuer));
|
||||
|
||||
@@ -154,7 +154,8 @@ void HashedObjectStore::bulkWrite()
|
||||
case hotTRANSACTION_NODE: type = 'N'; break;
|
||||
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;");
|
||||
|
||||
@@ -127,7 +127,7 @@ ProofOfWork ProofOfWorkGenerator::getProof()
|
||||
|
||||
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;
|
||||
s += "-" + Serializer::getSHA512Half(c).GetHex();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ std::string SHAMapNode::getString() const
|
||||
if ((mDepth == 0) && (mNodeID.isZero()))
|
||||
return "NodeID(root)";
|
||||
|
||||
return str(NodeID
|
||||
return str(boost::format(NodeID)
|
||||
% boost::lexical_cast<std::string>(mDepth)
|
||||
% 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)");
|
||||
std::string rTxn = sqlEscape(rawTxn.peekData());
|
||||
|
||||
return str(bfTrans
|
||||
return str(boost::format(bfTrans)
|
||||
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
||||
% 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)");
|
||||
std::string rTxn = sqlEscape(rawTxn.peekData());
|
||||
|
||||
return str(bfTrans
|
||||
return str(boost::format(bfTrans)
|
||||
% getTransactionID().GetHex() % getTransactionType() % getSourceAccount().humanAccountID()
|
||||
% getSequence() % inLedger % status % rTxn % escapedMetaData);
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void ValidationCollection::condWrite()
|
||||
void ValidationCollection::doWrite(Job&)
|
||||
{
|
||||
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);");
|
||||
|
||||
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)
|
||||
{
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user