mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-19 05:33:44 +01:00
Print transaction purpose in toString().
This commit is contained in:
parent
ab169f0700
commit
720f7d2a92
@ -717,6 +717,8 @@ public class Transaction extends ChildMessage {
|
||||
Coin fee = getFee();
|
||||
if (fee != null)
|
||||
s.append(" fee ").append(fee.toFriendlyString()).append(String.format("%n"));
|
||||
if (purpose != null)
|
||||
s.append(" prps ").append(purpose).append(String.format("%n"));
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@ import org.bitcoinj.core.listeners.TransactionReceivedInBlockListener;
|
||||
import org.bitcoinj.core.listeners.WalletEventListener;
|
||||
import org.bitcoinj.core.listeners.WalletChangeEventListener;
|
||||
import org.bitcoinj.core.listeners.WalletCoinEventListener;
|
||||
import org.bitcoinj.core.Transaction.Purpose;
|
||||
import org.bitcoinj.core.TransactionConfidence.*;
|
||||
import org.bitcoinj.crypto.*;
|
||||
import org.bitcoinj.params.*;
|
||||
@ -3024,6 +3025,9 @@ public class Wallet extends BaseTaggableObject
|
||||
builder.append(tx.getValueSentToMe(this).toFriendlyString());
|
||||
builder.append(", total value ");
|
||||
builder.append(tx.getValue(this).toFriendlyString());
|
||||
final Purpose purpose = tx.getPurpose();
|
||||
if (purpose != null)
|
||||
builder.append(", purpose: ").append(purpose);
|
||||
builder.append(".\n");
|
||||
} catch (ScriptException e) {
|
||||
// Ignore and don't print this line.
|
||||
|
Loading…
Reference in New Issue
Block a user