3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-18 21:25:49 +00:00

Transaction: Clarify the meaning of the transaction hash in the JavaDoc.

We will soon have multiple kinds of transaction hashes.
This commit is contained in:
Andreas Schildbach 2017-08-25 13:06:26 +02:00
parent e32feb0aa9
commit 9a3006d03c

View File

@ -133,7 +133,8 @@ public class Transaction extends ChildMessage {
// list of transactions from a wallet, which is helpful for presenting to users. // list of transactions from a wallet, which is helpful for presenting to users.
private Date updatedAt; private Date updatedAt;
// This is an in memory helper only. // This is an in memory helper only. It contains the transaction hash (aka txid), used as a reference by transaction
// inputs via outpoints.
private Sha256Hash hash; private Sha256Hash hash;
// Data about how confirmed this tx is. Serialized, may be null. // Data about how confirmed this tx is. Serialized, may be null.
@ -257,7 +258,8 @@ public class Transaction extends ChildMessage {
} }
/** /**
* Returns the transaction hash as you see them in the block explorer. * Returns the transaction hash (aka txid) as you see them in block explorers. It is used as a reference by
* transaction inputs via outpoints.
*/ */
@Override @Override
public Sha256Hash getHash() { public Sha256Hash getHash() {
@ -277,6 +279,9 @@ public class Transaction extends ChildMessage {
this.hash = hash; this.hash = hash;
} }
/**
* Returns the transaction hash (aka txid) as you see them in block explorers, as a hex string.
*/
public String getHashAsString() { public String getHashAsString() {
return getHash().toString(); return getHash().toString();
} }