mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-11-02 21:47:18 +00:00
Print more information in Transaction/Wallet toString outputs to reflect last seen block hash and confidence/depth data.
This commit is contained in:
@@ -522,13 +522,12 @@ public class Transaction extends ChildMessage implements Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A human readable version of the transaction useful for debugging.
|
||||
* A human readable version of the transaction useful for debugging. The format is not guaranteed to be stable.
|
||||
*/
|
||||
public String toString() {
|
||||
// Basic info about the tx.
|
||||
StringBuffer s = new StringBuffer();
|
||||
s.append(" ");
|
||||
s.append(getHashAsString());
|
||||
s.append("\n");
|
||||
s.append(String.format(" %s: %s\n", getHashAsString(), getConfidence()));
|
||||
if (inputs.size() == 0) {
|
||||
s.append(" INCOMPLETE: No inputs!\n");
|
||||
return s.toString();
|
||||
|
||||
@@ -277,13 +277,11 @@ public class TransactionConfidence implements Serializable {
|
||||
case NOT_SEEN_IN_CHAIN:
|
||||
builder.append("Not seen in chain.");
|
||||
break;
|
||||
case BUILDING:
|
||||
builder.append("Appeared in best chain at height ");
|
||||
builder.append(getAppearedAtChainHeight());
|
||||
builder.append(".");
|
||||
case BUILDING:
|
||||
builder.append(String.format("Appeared in best chain at height %d, depth %d, work done %s.",
|
||||
getAppearedAtChainHeight(), getDepthInBlocks(), getWorkDone()));
|
||||
break;
|
||||
}
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -1327,6 +1327,7 @@ public class Wallet implements Serializable {
|
||||
builder.append(String.format(" %d pending transactions\n", pending.size()));
|
||||
builder.append(String.format(" %d inactive transactions\n", inactive.size()));
|
||||
builder.append(String.format(" %d dead transactions\n", dead.size()));
|
||||
builder.append(String.format("Last seen best block: %s\n", getLastBlockSeenHash()));
|
||||
// Do the keys.
|
||||
builder.append("\nKeys:\n");
|
||||
for (ECKey key : keychain) {
|
||||
|
||||
Reference in New Issue
Block a user