diff options
| author | Bitflash <btf01@proton.me> | 2026-08-04 15:14:46 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-04 15:14:46 -0300 |
| commit | 7aaaa7a684e33591125963df1eb4da6da2fa6495 (patch) | |
| tree | 2f7424565e2422ed80dfc76232ed056fa14cf5f6 /src/proxy.cpp | |
| parent | a2592156207ed04671d6532cec4997fb1dab1595 (diff) | |
rpc: build the pool block template the way the solo miner does (#141)
Two bugs in RebuildJob(), the operator's Stratum template builder. It
is a separate path from BitcoinMiner() and had drifted from it.
A single pass over mapTransactions is not enough. That map is keyed by
hash and carries no dependency order, so a transaction spending another
still-unconfirmed transaction's output -- change from a recent send,
usually -- fails ConnectInputs whenever its parent sits later in map
order. One pass drops it, and map order does not change between
rebuilds, so every later rebuild drops it at the same point. That is
deterministic exclusion rather than bad luck: where pool operators mine
most blocks, a transaction of that shape can stay unconfirmed for as
long as its parent is. Now it retries until a pass adds nothing, which
is what the solo builder has always done.
And the fees reached nobody. nFees was declared inside the scan loop, so
each transaction reset it and the running total was discarded, while the
coinbase line passed a hardcoded 0. An operator collected fees into a
block and paid none of them out. The block stayed valid, since paying
less than allowed always is, so nothing ever complained.
Both the diagnosis and the fix are Vic-Nas's, from his fork of this
code. He deleted the fork, so this brings the work back rather than
letting it go with it. His description of the failure was precise enough
that finding the same two defects here took one read of our RebuildJob.
Diffstat (limited to 'src/proxy.cpp')
0 files changed, 0 insertions, 0 deletions