From bc37ab7d47834f48e006eb34e131293e8b96a2b3 Mon Sep 17 00:00:00 2001 From: pinpong Date: Mon, 25 Sep 2017 22:28:48 +0200 Subject: [PATCH] fixed timestamp --- src/main/java/jota/IotaAPICore.java | 4 ++-- src/main/java/jota/model/Transaction.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/jota/IotaAPICore.java b/src/main/java/jota/IotaAPICore.java index 0d5d354..dc5e2d1 100644 --- a/src/main/java/jota/IotaAPICore.java +++ b/src/main/java/jota/IotaAPICore.java @@ -204,7 +204,7 @@ public class IotaAPICore { txn.setBranchTransaction(previousTransaction == null ? branchTransaction : trunkTransaction); if (txn.getTag().isEmpty() || txn.getTag().matches("9*")) txn.setTag(txn.getObsoleteTag()); - txn.setAttachmentTimestamp(System.currentTimeMillis() / 1000L); + txn.setAttachmentTimestamp(System.currentTimeMillis()); txn.setAttachmentTimestampLowerBound(0); txn.setAttachmentTimestampUpperBound(3_812_798_742_493L); resultTrytes[i] = localPoW.performPoW(txn.toTrytes(), minWeightMagnitude); @@ -329,7 +329,7 @@ public class IotaAPICore { } /** - * @param protocol + * @param localPoW * @return */ public T localPoW(IotaLocalPoW localPoW) { diff --git a/src/main/java/jota/model/Transaction.java b/src/main/java/jota/model/Transaction.java index 29c5cae..cedce1f 100644 --- a/src/main/java/jota/model/Transaction.java +++ b/src/main/java/jota/model/Transaction.java @@ -480,7 +480,7 @@ public class Transaction { this.setTrunkTransaction(trytes.substring(2430, 2511)); this.setBranchTransaction(trytes.substring(2511, 2592)); this.setTag(trytes.substring(2592, 2619)); - this.setAttachmentTimestamp(Converter.longValue(Arrays.copyOfRange(transactionTrits, 7857, 7884)) / 1000); + this.setAttachmentTimestamp(Converter.longValue(Arrays.copyOfRange(transactionTrits, 7857, 7884))); this.setAttachmentTimestampLowerBound(Converter.longValue(Arrays.copyOfRange(transactionTrits, 7884, 7911))); this.setAttachmentTimestampUpperBound(Converter.longValue(Arrays.copyOfRange(transactionTrits, 7911, 7938))); this.setNonce(trytes.substring(2646, 2673));