This makes orphan processing work like handling getdata messages:
After every actual transaction validation attempt, interrupt
processing to deal with messages arriving from other peers.
(cherry picked from commit bitcoin/bitcoin@866c8058a7)
Although this increases node memory usage in the worst case by perhaps
30MB, the current behavior causes severe issues with dependent tx relay.
(cherry picked from commit bitcoin/bitcoin@54326a6808)
An orphan whos parents were rejected is never going to connect, so there
is little utility in keeping it.
Orphans also helpfully tell us what we're missing, so go ahead and treat
it as INVed.
(cherry picked from commit bitcoin/bitcoin@8c99d1b525)
Zcash: Adapted to our INV changes.
This prevents higher order orphans and other junk from
holding positions in the orphan map. Parents delayed
twenty minutes are more are unlikely to ever arrive.
The freed space will improve the orphan matching success rate for
other transactions.
(cherry picked from commit bitcoin/bitcoin@11cc143895)
always grow to its maximum size.
This does not go so far as to attempt to connect orphans made
connectable by a new block.
Keeping the orphan map less full helps improve the reliability
of relaying chains of transactions.
(cherry picked from commit bitcoin/bitcoin@db0ffe80a0)
and `ReceivedBlockTransactions`) are required to take a lock on `cs_main`
in order to work when compiled with `--enable-debug`.
Also, `ReceivedBlockTransactions` added the passed-in index pointer to
the global `setDirtyBlockIndex`, which would cause UB in the test (because
nothing removes it before the fake index is destructed). Refactor this so
that non-test callers add the index pointer to `setDirtyBlockIndex`
outside the call to `ReceivedBlockTransactions`.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
pool balances (Sapling, Orchard, and Lockbox). This is not a very thorough
test but it will do for now.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
network upgrades:
* after Blossom, there is an extra halving of the block reward;
* after NU5, `nExpiryHeight` must be equal to the block height;
* after NU6, we need to take into account the lockbox value.
Also we rename `hashFinalSaplingRoot` to `hashBlockCommitments`,
and make `CBlock.rehash` implicitly recalculate the `hashMerkleRoot`
and `hashAuthDataRoot` fields.
Signed-off-by: Daira-Emma Hopwood <daira@jacaranda.org>
After the implementation of ZIP 236, `TestBlockValidity` would fail to
correctly handle blocks newly created by the miner because the value
allocated to the lockbox was not computed in the path to calling
`ContextualCheckBlock`. This refactors the computation of the lockbox
value and other pool values such that it is always performed prior to
invoking `CheckBlock`.
Secondarily, the `coinbase_funding_streams` test was previously
inadvertently creating a silent chain fork by applying different funding
stream rules on the node on which the block was created relative to the
second node used in the test.
Author: Kris Nuttycombe <kris@nutty.land>
Co-authored-by: Daira-Emma Hopwood <daira@jacaranda.org>