mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
TransactionOutput: simplify method isDust()
Replace `if` with boolean logic and revise related comment.
This commit is contained in:
parent
f907a6b86f
commit
fa323f745e
@ -203,9 +203,8 @@ public class TransactionOutput {
|
||||
*/
|
||||
public boolean isDust() {
|
||||
// Transactions that are OP_RETURN can't be dust regardless of their value.
|
||||
if (ScriptPattern.isOpReturn(getScriptPubKey()))
|
||||
return false;
|
||||
return getValue().isLessThan(getMinNonDustValue());
|
||||
// If output is not OP_RETURN and value is below getMinNonDustValue() it is dust.
|
||||
return !ScriptPattern.isOpReturn(getScriptPubKey()) && getValue().isLessThan(getMinNonDustValue());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user