Skip to content

Commit

Permalink
Handle DPT_MIN_REMAINDER_TO_LEGACY_BM with isHotfixActivated param
Browse files Browse the repository at this point in the history
Signed-off-by: HenrikJannsen <[email protected]>
  • Loading branch information
HenrikJannsen committed Jan 6, 2023
1 parent b872683 commit fa82990
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public static boolean isHotfixActivated() {
// than DPT_MIN_REMAINDER_TO_LEGACY_BM, otherwise we spend it as miner fee.
// 25000 sat is about 5 USD @ 20k price. We use a rather high value as we want to avoid that the legacy BM
// gets still payouts.
private static final long DPT_MIN_REMAINDER_TO_LEGACY_BM = isHotfixActivated() ? 25000 : 50000;
private static final long DPT_MIN_REMAINDER_TO_LEGACY_BM = 25000;

// Min. fee rate for DPT. If fee rate used at take offer time was higher we use that.
// We prefer a rather high fee rate to not risk that the DPT gets stuck if required fee rate would
Expand Down Expand Up @@ -189,7 +189,8 @@ public List<Tuple2<Long, String>> getReceivers(int burningManSelectionHeight,
long available = spendableAmount - totalOutputValue;
// If the available is larger than DPT_MIN_REMAINDER_TO_LEGACY_BM we send it to legacy BM
// Otherwise we use it as miner fee
if (available > DPT_MIN_REMAINDER_TO_LEGACY_BM) {
long dptMinRemainderToLegacyBm = isHotfixActivated ? DPT_MIN_REMAINDER_TO_LEGACY_BM : 50000;
if (available > dptMinRemainderToLegacyBm) {
receivers.add(new Tuple2<>(available, burningManService.getLegacyBurningManAddress(burningManSelectionHeight)));
}
}
Expand Down

0 comments on commit fa82990

Please sign in to comment.