Skip to content

Commit

Permalink
Check that forceSmallChangeAsFee > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
blckngm committed Jul 21, 2023
1 parent 90e8775 commit f4dd99e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,17 @@ public Long getForceSmallChangeAsFee() {
}

/**
* Set forceSmallChangeAsFee. When building transaction, a change output will not be required if it would be smaller than the specified amount.
* Set forceSmallChangeAsFee. When building transaction, a change output will not be required if its capacity would be
* smaller than the specified amount.
*
* @param forceSmallChangeAsFee Unit shannons
* @param forceSmallChangeAsFee Should be positive. Unit is shannons.
*/
public void setForceSmallChangeAsFee(@Nullable Long forceSmallChangeAsFee) {
if (forceSmallChangeAsFee != null) {
if (forceSmallChangeAsFee <= 0) {
throw new IllegalArgumentException("invalid forceSmallChangeAsFee: " + forceSmallChangeAsFee);
}
}
this.forceSmallChangeAsFee = forceSmallChangeAsFee;
}
}

0 comments on commit f4dd99e

Please sign in to comment.