Add a Transaction.getValue(Wallet) method.

This commit is contained in:
Mike Hearn
2012-03-01 18:55:46 +01:00
parent ddb6da155b
commit 40bd728703
2 changed files with 8 additions and 0 deletions

View File

@@ -288,6 +288,13 @@ public class Transaction extends ChildMessage implements Serializable {
return v;
}
/**
* Returns the difference of {@link Transaction#getValueSentFromMe(Wallet)} and {@link Transaction#getValueSentToMe(Wallet)}.
*/
public BigInteger getValue(Wallet wallet) throws ScriptException {
return getValueSentToMe(wallet).subtract(getValueSentFromMe(wallet));
}
boolean disconnectInputs() {
boolean disconnected = false;
maybeParse();