Fix accelerator revenue impact always showing zero
The old approach compared coinbasevalue from two getblocktemplate calls, but new mempool arrivals between calls masked the displacement loss. Now uses a single template snapshot to find the marginal (lowest fee-rate) transaction that would be displaced and reports its fee as the revenue cost.
This commit is contained in:
@@ -69,7 +69,7 @@
|
||||
} else if (feeLostSats > 0) {
|
||||
success = `Boosted from ${from} to ${to} sat/vB. Revenue impact: -${feeLostSats.toLocaleString()} sats (${(feeLostSats / 1e8).toFixed(8)} BTC) per block mined.`;
|
||||
} else {
|
||||
success = `Boosted from ${from} to ${to} sat/vB. No revenue impact — the displaced transaction's fee was equal or lower.`;
|
||||
success = `Boosted from ${from} to ${to} sat/vB. No revenue impact — the transaction was already in the template or the mempool fits in one block.`;
|
||||
}
|
||||
txid = "";
|
||||
feerateInput = "";
|
||||
@@ -169,9 +169,9 @@
|
||||
mempool isn't full (all transactions already fit), there is <em>zero cost</em>.
|
||||
</p>
|
||||
<p>
|
||||
<strong>Revenue impact:</strong> After boosting, the server compares the block template's
|
||||
coinbase value before and after. The difference (if any) is the actual fee revenue
|
||||
lost per block mined. This is shown after each boost.
|
||||
<strong>Revenue impact:</strong> The server inspects the current block template to find
|
||||
the marginal transaction — the lowest fee-rate tx that would be displaced by the
|
||||
boosted one. Its fee is the revenue you sacrifice per block mined, shown after each boost.
|
||||
</p>
|
||||
<p>
|
||||
Your pool: {formatHashrate(poolHashrate)} /
|
||||
|
||||
Reference in New Issue
Block a user