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)
|
||||
{
|
||||
Serializer rawTxn(2048);
|
||||
Serializer rawTxn;
|
||||
std::string status;
|
||||
uint32 inLedger;
|
||||
|
||||
int txSize = 2048;
|
||||
rawTxn.resize(txSize);
|
||||
|
||||
{
|
||||
ScopedLock sl(theApp->getTxnDB()->getDBLock());
|
||||
Database* db = theApp->getTxnDB()->getDB();
|
||||
@@ -548,15 +551,15 @@ Transaction::pointer Transaction::transactionFromSQL(const std::string& sql)
|
||||
|
||||
db->getStr("Status", status);
|
||||
inLedger = db->getInt("LedgerSeq");
|
||||
int txSize = db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.capacity());
|
||||
if (txSize > rawTxn.size())
|
||||
txSize = db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.getLength());
|
||||
if (txSize > rawTxn.getLength())
|
||||
{
|
||||
rawTxn.resize(txSize);
|
||||
db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.capacity());
|
||||
db->getBinary("RawTxn", &*rawTxn.begin(), rawTxn.getLength());
|
||||
}
|
||||
else rawTxn.resize(txSize);
|
||||
db->endIterRows();
|
||||
}
|
||||
rawTxn.resize(txSize);
|
||||
|
||||
SerializerIterator it(rawTxn);
|
||||
SerializedTransaction::pointer txn = boost::make_shared<SerializedTransaction>(boost::ref(it));
|
||||
|
||||
Reference in New Issue
Block a user