From 75701c725d00a11f7a3931190d029378a04be8f6 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 11 Jun 2020 16:59:24 +0200 Subject: [PATCH] keep block hash --- .../sparrowwallet/drongo/wallet/BlockTransaction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransaction.java b/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransaction.java index da102bf..1074583 100644 --- a/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransaction.java +++ b/src/main/java/com/sparrowwallet/drongo/wallet/BlockTransaction.java @@ -7,16 +7,26 @@ import java.util.Date; public class BlockTransaction extends BlockTransactionHash implements Comparable { private final Transaction transaction; + private final Sha256Hash blockHash; public BlockTransaction(Sha256Hash hash, int height, Date date, Long fee, Transaction transaction) { + this(hash, height, date, fee, transaction, null); + } + + public BlockTransaction(Sha256Hash hash, int height, Date date, Long fee, Transaction transaction, Sha256Hash blockHash) { super(hash, height, date, fee); this.transaction = transaction; + this.blockHash = blockHash; } public Transaction getTransaction() { return transaction; } + public Sha256Hash getBlockHash() { + return blockHash; + } + @Override public int compareTo(BlockTransaction blockchainTransaction) { return super.compareTo(blockchainTransaction);