Skip to content

Commit

Permalink
Exclude OP_RETURN from the MIN_ANALYSIS_NONDUST_OUTPUT check
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer authored and oscarguindzberg committed Jan 3, 2019
1 parent 4c47b4c commit d0d8dcb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ public static RuleViolation isStandard(Transaction tx) {
* Checks the output to see if the script violates a standardness rule. Not complete.
*/
public static RuleViolation isOutputStandard(TransactionOutput output) {
if (output.getValue().compareTo(MIN_ANALYSIS_NONDUST_OUTPUT) < 0)
// OP_RETURN has usually output value zero, so we exclude that from the MIN_ANALYSIS_NONDUST_OUTPUT check
if (!output.getScriptPubKey().isOpReturn()
&& output.getValue().compareTo(MIN_ANALYSIS_NONDUST_OUTPUT) < 0)
return RuleViolation.DUST;
for (ScriptChunk chunk : output.getScriptPubKey().getChunks()) {
if (chunk.isPushData() && !chunk.isShortestPossiblePushData())
Expand Down

0 comments on commit d0d8dcb

Please sign in to comment.