Skip to content

Commit

Permalink
del create timestamp index
Browse files Browse the repository at this point in the history
  • Loading branch information
Yrp committed Aug 14, 2018
1 parent 35b822b commit f9a5058
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/tron/core/db/api/StoreAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public List<Transaction> getTransactionsFromThis(String address, long offset, lo
index.retrieve(
equal(TransactionIndex.OWNERS, address),
queryOptions(
orderBy(ascending(TransactionIndex.INDEX_CREATE_TIMESTAMP))))) {
orderBy(ascending(TransactionIndex.TIMESTAMP))))) {
if (limit > TRANSACTIONS_COUNT_LIMIT_MAX) {
limit = TRANSACTIONS_COUNT_LIMIT_MAX;
}
Expand All @@ -118,7 +118,7 @@ public List<Transaction> getTransactionsToThis(String address, long offset, long
index.retrieve(
equal(TransactionIndex.TOS, address),
queryOptions(
orderBy(ascending(TransactionIndex.INDEX_CREATE_TIMESTAMP))))) {
orderBy(ascending(TransactionIndex.TIMESTAMP))))) {
if (limit > TRANSACTIONS_COUNT_LIMIT_MAX) {
limit = TRANSACTIONS_COUNT_LIMIT_MAX;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class TransactionIndex extends AbstractIndex<TransactionCapsule, Transact
public static Attribute<WrappedByteArray, String> OWNERS;
public static Attribute<WrappedByteArray, String> TOS;
public static Attribute<WrappedByteArray, Long> TIMESTAMP;
public static Attribute<WrappedByteArray, Long> INDEX_CREATE_TIMESTAMP;

@Autowired
public TransactionIndex(
Expand All @@ -42,7 +41,6 @@ public void init() {
index.addIndex(DiskIndex.onAttribute(OWNERS));
index.addIndex(DiskIndex.onAttribute(TOS));
index.addIndex(DiskIndex.onAttribute(TIMESTAMP));
index.addIndex(DiskIndex.onAttribute(INDEX_CREATE_TIMESTAMP));
}

@Override
Expand All @@ -66,8 +64,5 @@ protected void setAttribute() {
.collect(Collectors.toList()));
TIMESTAMP =
attribute("timestamp", bytes -> getObject(bytes).getRawData().getTimestamp());
INDEX_CREATE_TIMESTAMP =
attribute("index create timestamp", bytes -> System.currentTimeMillis());

}
}

0 comments on commit f9a5058

Please sign in to comment.