5 path = _path +
"/resultsDB";
6 options.create_if_missing =
true;
7 leveldb::Status status = leveldb::DB::Open(
options,
path, &
db);
9 LogPrintf(
"Opened LevelDB successfully\n");
31 leveldb::Status result = leveldb::DestroyDB(
path, leveldb::Options());
40 std::string keyTemp = hashTx.
hex();
41 leveldb::Slice key(keyTemp);
42 leveldb::Status status =
db->Delete(leveldb::WriteOptions(), key);
49 std::vector<TransactionReceiptInfo> result;
64 std::string valueTemp;
65 std::string keyTemp = i.first.hex();
66 leveldb::Slice key(keyTemp);
67 leveldb::Status status =
db->Get(leveldb::ReadOptions(), key, &valueTemp);
69 if (status.IsNotFound()) {
72 for (
size_t j = 0; j < i.second.size(); j++) {
77 tris.
senders.push_back(i.second[j].from);
83 tris.
excepted.push_back(uint32_t(static_cast<int>(i.second[j].excepted)));
91 std::string stringData(data.begin(), data.end());
92 leveldb::Slice value(stringData);
93 status =
db->Put(leveldb::WriteOptions(), key, value);
97 m_cache_result.clear();
104 std::string keyTemp = _key.
hex();
106 leveldb::Slice key(keyTemp);
107 leveldb::Status s =
db->Get(leveldb::ReadOptions(), key, &value);
109 if (!s.IsNotFound() && s.ok()) {
126 for (
size_t j = 0; j < tris.
blockHashes.size(); j++) {
130 _result.push_back(tri);
141 result.push_back(std::make_pair(i.address, std::make_pair(i.topics, i.data)));
149 for (std::pair<
dev::Address, std::pair<dev::h256s, dev::bytes>> i : _logs) {
logEntriesSerializ logEntriesSerialization(dev::eth::LogEntries const &_logs)
std::vector< dev::h160 > senders
std::vector< TransactionReceiptInfo > getResult(dev::h256 const &hashTx)
std::vector< std::pair< dev::Address, std::pair< dev::h256s, dev::bytes >>> logEntriesSerializ
std::vector< T > toVector(int _flags=LaissezFaire) const
std::vector< dev::h160 > contractAddresses
bytes const & out() const
Read the byte stream.
dev::eth::LogEntries logEntriesDeserialize(logEntriesSerializ const &_logs)
std::vector< dev::u256 > cumulativeGasUsed
std::unordered_map< dev::h256, std::vector< TransactionReceiptInfo > > m_cache_result
assert(len-trim+(2 *lenIndices)<=WIDTH)
std::vector< dev::h256 > transactionHashes
std::shared_ptr< const CTransaction > CTransactionRef
std::vector< uint32_t > blockNumbers
StorageResults(std::string const &_path)
std::vector< uint32_t > transactionIndexes
dev::h256 uintToh256(const uint256 &in)
std::vector< dev::h160 > receivers
std::vector< logEntriesSerializ > logs
std::vector< dev::u256 > gasUsed
std::vector< byte > bytes
std::vector< uint32_t > excepted
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
std::vector< dev::h256 > blockHashes
void addResult(dev::h256 hashTx, std::vector< TransactionReceiptInfo > &result)
bool readResult(dev::h256 const &_key, std::vector< TransactionReceiptInfo > &_result)
void deleteResults(std::vector< CTransactionRef > const &txs)
Class for writing to an RLP bytestream.
Class for interpreting Recursive Linear-Prefix Data.
uint256 h256Touint(const dev::h256 &in)
std::vector< LogEntry > LogEntries