Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #273

Merged
merged 2 commits into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class TransactionHistoryStoreImpl implements TransactionHistoryStore {
private static final int BLOCK_ADDRESS_FLAG = 0;
private static final int WALLET_ADDRESS_FLAG = 1;

private static final int Default_PAGE_SIZE = 100;
private static final int DEFAULT_PAGE_SIZE = 100;
private Connection connBatch = null;
private PreparedStatement pstmtBatch = null;
private int count = 0;
Expand All @@ -84,7 +84,7 @@ public boolean saveTxHistory(TxHistory txHistory) {
pstmt.setString(3, txHistory.getHash());
pstmt.setBigDecimal(4, address.getAmount().toDecimal(9, XUnit.XDAG));
pstmt.setInt(5, address.getType().asByte());
pstmt.setString(6, txHistory.getRemark());
pstmt.setString(6, txHistory.getRemark() != null ? txHistory.getRemark().trim() : "");
pstmt.setTimestamp(7,
new java.sql.Timestamp(XdagTime.xdagTimestampToMs(txHistory.getTimestamp())));
result = pstmt.executeUpdate() == 1;
Expand Down Expand Up @@ -120,7 +120,7 @@ public boolean batchSaveTxHistory(TxHistory txHistory, int... cacheNum) {
pstmtBatch.setString(3, txHistory.getHash());
pstmtBatch.setBigDecimal(4, address.getAmount().toDecimal(9, XUnit.XDAG));
pstmtBatch.setInt(5, address.getType().asByte());
pstmtBatch.setString(6, txHistory.getRemark());
pstmtBatch.setString(6, txHistory.getRemark() != null ? txHistory.getRemark().trim() : "");
pstmtBatch.setTimestamp(7,
new java.sql.Timestamp(XdagTime.xdagTimestampToMs(txHistory.getTimestamp())));
pstmtBatch.addBatch();
Expand Down Expand Up @@ -162,7 +162,7 @@ public List<TxHistory> listTxHistoryByAddress(String address, int page, Object..
ResultSet rs = null;
List<TxHistory> txHistoryList = Lists.newArrayList();
int totalcount = 0;
int PAGE_SIZE = Default_PAGE_SIZE;
int PAGE_SIZE = DEFAULT_PAGE_SIZE;
long start = new Date(0).getTime();
long end = System.currentTimeMillis();
switch (parameters.length) {
Expand Down
Loading