mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix the bug Jed reported.
This commit is contained in:
@@ -535,10 +535,13 @@ bool Transaction::save()
|
|||||||
|
|
||||||
Transaction::pointer Transaction::transactionFromSQL(const std::string& sql)
|
Transaction::pointer Transaction::transactionFromSQL(const std::string& sql)
|
||||||
{
|
{
|
||||||
Serializer rawTxn(2048);
|
Serializer rawTxn;
|
||||||
std::string status;
|
std::string status;
|
||||||
uint32 inLedger;
|
uint32 inLedger;
|
||||||
|
|
||||||
|
int txSize = 2048;
|
||||||
|
rawTxn.resize(txSize);
|
||||||
|
|
||||||
{
|
{
|
||||||
ScopedLock sl(theApp->getTxnDB()->getDBLock());
|
ScopedLock sl(theApp->getTxnDB()->getDBLock());
|
||||||
Database* db = theApp->getTxnDB()->getDB();
|
Database* db = theApp->getTxnDB()->getDB();
|
||||||
@@ -548,15 +551,15 @@ Transaction::pointer Transaction::transactionFromSQL(const std::string& sql)
|
|||||||
|
|
||||||
db->getStr("Status", status);
|
db->getStr("Status", status);
|
||||||
inLedger = db->getInt("LedgerSeq");
|
inLedger = db->getInt("LedgerSeq");
|
||||||
int txSize = db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.capacity());
|
txSize = db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.getLength());
|
||||||
if (txSize > rawTxn.size())
|
if (txSize > rawTxn.getLength())
|
||||||
{
|
{
|
||||||
rawTxn.resize(txSize);
|
rawTxn.resize(txSize);
|
||||||
db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.capacity());
|
db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.getLength());
|
||||||
}
|
}
|
||||||
else rawTxn.resize(txSize);
|
|
||||||
db->endIterRows();
|
db->endIterRows();
|
||||||
}
|
}
|
||||||
|
rawTxn.resize(txSize);
|
||||||
|
|
||||||
SerializerIterator it(rawTxn);
|
SerializerIterator it(rawTxn);
|
||||||
SerializedTransaction::pointer txn = boost::make_shared<SerializedTransaction>(boost::ref(it));
|
SerializedTransaction::pointer txn = boost::make_shared<SerializedTransaction>(boost::ref(it));
|
||||||
|
|||||||
Reference in New Issue
Block a user