Cache tid in STTx:

The digest for a transaction (its transaction ID, or tid) is
computed once upon constructed when the STTx is deserialized.
Subsequent calls to retrieve the digest use the cached value.

Any code which modifies the STTx and then attempts to
retrieve the digest will terminate the process with a
logic error contract violation.

* Nested types removed
* All STTx are contained as const
  (Except in transaction sign, which must modify)
* tid in STTx is computed once on deserialization
This commit is contained in:
Vinnie Falco
2015-10-14 15:18:37 -07:00
parent 0622e4fd44
commit 8296d81edf
20 changed files with 91 additions and 59 deletions

View File

@@ -1164,7 +1164,7 @@ void LedgerConsensusImp::accept (std::shared_ptr<SHAMap> set)
<< " not get in";
SerialIter sit (it.second->peekTransaction().slice());
auto txn = std::make_shared<STTx>(sit);
auto txn = std::make_shared<STTx const>(sit);
retriableTxs.insert (txn);