diff --git a/khipu-eth/src/main/scala/khipu/storage/KesqueNodeCompactor.scala b/khipu-eth/src/main/scala/khipu/storage/KesqueNodeCompactor.scala index 730aa1b..244a66e 100644 --- a/khipu-eth/src/main/scala/khipu/storage/KesqueNodeCompactor.scala +++ b/khipu-eth/src/main/scala/khipu/storage/KesqueNodeCompactor.scala @@ -14,6 +14,7 @@ import khipu.DataWord import khipu.config.DbConfig import khipu.config.KhipuConfig import khipu.config.RocksdbConfig +import khipu.crypto import khipu.domain.Account import khipu.rlp import khipu.storage.datasource.KesqueBlockDataSource @@ -137,11 +138,12 @@ object KesqueNodeCompactor { def flush() { val kvs = buf map { - case TKeyVal(key, value, offset) => + case TKeyVal(_, value, offset) => _maxOffset = math.max(_maxOffset, offset) + val key = crypto.kec256(value) Hash(key) -> value } - //nodeDataSource.update(Nil, kvs) + nodeDataSource.update(Nil, kvs) buf.clear() } diff --git a/khipu-kesque/src/main/scala/khipu/storage/datasource/KesqueNodeDataSource.scala b/khipu-kesque/src/main/scala/khipu/storage/datasource/KesqueNodeDataSource.scala index cb23ce9..7e2dc1d 100644 --- a/khipu-kesque/src/main/scala/khipu/storage/datasource/KesqueNodeDataSource.scala +++ b/khipu-kesque/src/main/scala/khipu/storage/datasource/KesqueNodeDataSource.scala @@ -106,7 +106,6 @@ final class KesqueNodeDataSource( var records = Vector[SimpleRecord]() toUpsert foreach { case kv @ (key, value) => - val keyBytes = key.bytes val record = new SimpleRecord(null, value) if (firstTimestamp == Long.MinValue) { firstTimestamp = 0