Large speed up of getField* functions on non-free objects such as transactions and ledger nodes.

This commit is contained in:
JoelKatz
2013-02-28 23:52:53 -08:00
parent fca5683d31
commit 7a9037d1ca
9 changed files with 83 additions and 66 deletions

View File

@@ -6,25 +6,22 @@
DECLARE_INSTANCE(SerializedValidation);
std::vector<SOElement::ref> sValidationFormat;
SOTemplate sValidationFormat;
static bool SVFInit()
void SVFInit()
{
sValidationFormat.push_back(new SOElement(sfFlags, SOE_REQUIRED));
sValidationFormat.push_back(new SOElement(sfLedgerHash, SOE_REQUIRED));
sValidationFormat.push_back(new SOElement(sfLedgerSequence, SOE_OPTIONAL));
sValidationFormat.push_back(new SOElement(sfCloseTime, SOE_OPTIONAL));
sValidationFormat.push_back(new SOElement(sfLoadFee, SOE_OPTIONAL));
sValidationFormat.push_back(new SOElement(sfBaseFee, SOE_OPTIONAL));
sValidationFormat.push_back(new SOElement(sfFeatures, SOE_OPTIONAL));
sValidationFormat.push_back(new SOElement(sfSigningTime, SOE_REQUIRED));
sValidationFormat.push_back(new SOElement(sfSigningPubKey, SOE_REQUIRED));
sValidationFormat.push_back(new SOElement(sfSignature, SOE_OPTIONAL));
return true;
sValidationFormat.push_back(SOElement(sfFlags, SOE_REQUIRED));
sValidationFormat.push_back(SOElement(sfLedgerHash, SOE_REQUIRED));
sValidationFormat.push_back(SOElement(sfLedgerSequence, SOE_OPTIONAL));
sValidationFormat.push_back(SOElement(sfCloseTime, SOE_OPTIONAL));
sValidationFormat.push_back(SOElement(sfLoadFee, SOE_OPTIONAL));
sValidationFormat.push_back(SOElement(sfBaseFee, SOE_OPTIONAL));
sValidationFormat.push_back(SOElement(sfFeatures, SOE_OPTIONAL));
sValidationFormat.push_back(SOElement(sfSigningTime, SOE_REQUIRED));
sValidationFormat.push_back(SOElement(sfSigningPubKey, SOE_REQUIRED));
sValidationFormat.push_back(SOElement(sfSignature, SOE_OPTIONAL));
};
bool SVFinitComplete = SVFInit();
const uint32 SerializedValidation::sFullFlag = 0x1;
SerializedValidation::SerializedValidation(SerializerIterator& sit, bool checkSignature)