Skip to content

Commit

Permalink
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 9d7b441 commit 7ab21da
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ 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 = 25000;
private static final long DPT_MIN_REMAINDER_TO_LEGACY_BM = isHotfixActivated() ? 25000 : 50000;

// 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
// spike when opening arbitration.
private static final long DPT_MIN_TX_FEE_RATE = 10;


private final DaoStateService daoStateService;
private final BurningManService burningManService;
private int currentChainHeight;
Expand Down Expand Up @@ -152,7 +151,9 @@ public List<Tuple2<Long, String>> getReceivers(int burningManSelectionHeight,
// If we remove outputs it will be spent as miner fee.
long minOutputAmount = Math.max(DPT_MIN_OUTPUT_AMOUNT, txFeePerVbyte * 32 * 2);
// Sanity check that max share of a non-legacy BM is 20% over MAX_BURN_SHARE (taking into account potential increase due adjustment)
long maxOutputAmount = Math.round(spendableAmount * (BurningManService.MAX_BURN_SHARE * 1.2));
long maxOutputAmount = isHotfixActivated() ?
Math.round(spendableAmount * (BurningManService.MAX_BURN_SHARE * 1.2)) :
Math.round(inputAmount * (BurningManService.MAX_BURN_SHARE * 1.2));
// We accumulate small amounts which gets filtered out and subtract it from 1 to get an adjustment factor
// used later to be applied to the remaining burningmen share.
double adjustment = 1 - burningManCandidates.stream()
Expand Down

0 comments on commit 7ab21da

Please sign in to comment.