diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-09 03:18:25 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-08-19 22:48:26 +0000 |
| commit | d6972a0ca2269441c7a1125d528fc577c242be7d (patch) | |
| tree | f257f8beccc28a0cea5a75a9560416752ca017f8 /src/main.h | |
| parent | 82ac5bbc05a1de2be752e2f89110af1e424bc863 (diff) | |
payout: say what actually failed instead of blaming transaction size
SendMoney's "oversized transaction that requires a transaction fee of
0.00" is not an oversized transaction and there is no fee. That branch is
taken when nValue + nFeeRequired > GetBalance() -- an empty spendable
balance -- and the fee reads 0.00 because CreateTransaction failed before
setting one. 3,267 of these in debug.log sent me looking for a
transaction-size problem that does not exist. Report what is short, by how
much, and against what balance.
Name COINBASE_SPENDABLE_DEPTH in main.h and derive GetBlocksToMaturity
from it, because the distinction it captures is genuinely surprising:
CMerkleTx::GetCredit values a mined coinbase at zero until
COINBASE_MATURITY+20 deep, not COINBASE_MATURITY.
I first changed the payout gate to that deeper value, on the theory that
each payout was firing 20 blocks before its own coinbase could be spent.
Measuring it refuted that: across 934 payments, 96% succeeded at depth
100, the moment they were queued, which is only possible because a payout
is funded from whatever coin is already mature rather than from its own
block. The gate stays at COINBASE_MATURITY, with a comment recording the
measurement so the next person does not re-make the same change.
The real shortfall is structural and not addressed here: the pool pays out
~99% of each block's subsidy while only matured coinbases are spendable,
so it runs with almost no buffer, and any orphaned block it queued a
payout for drains that buffer permanently. The 24h retry loop absorbs this
-- 0 payouts forfeited -- but the buffer is what needs fixing.
(cherry picked from commit e28df01f90d621b0cd818f28d70a20b8ab5d1a8d)
Diffstat (limited to 'src/main.h')
| -rw-r--r-- | src/main.h | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -41,6 +41,12 @@ static const int64 MAX_MONEY = 21000000 * COIN; | |||
| 41 | inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } | 41 | inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } |
| 42 | static const int64 CENT = 1000000; | 42 | static const int64 CENT = 1000000; |
| 43 | static const int COINBASE_MATURITY = 100; | 43 | static const int COINBASE_MATURITY = 100; |
| 44 | // Depth at which a coinbase we mined is actually usable. CMerkleTx::GetCredit | ||
| 45 | // values a coinbase at zero until GetBlocksToMaturity() reaches 0, which is | ||
| 46 | // this depth -- not COINBASE_MATURITY. Anything that plans to *spend* mined | ||
| 47 | // coin must gate on this, or it will try to pay out of a balance the wallet | ||
| 48 | // still reports as zero. Both rules live here so they cannot drift apart. | ||
| 49 | static const int COINBASE_SPENDABLE_DEPTH = COINBASE_MATURITY + 20; | ||
| 44 | 50 | ||
| 45 | // Bitflash difficulty floor. The PoW is RandomX (memory-hard), ~1000x slower | 51 | // Bitflash difficulty floor. The PoW is RandomX (memory-hard), ~1000x slower |
| 46 | // per hash than SHA-256d, so the target is much easier than Bitcoin's to let a | 52 | // per hash than SHA-256d, so the target is much easier than Bitcoin's to let a |