The Orphan Pool: Handling transactions with missing parents
The Orphan Pool: Handling transactions with missing parents
Sometimes, the "Child" arrives before the "Parent." You receive Transaction B, which spends coins from Transaction A, but you haven't seen Transaction A yet. In the early days, the node would just "Ignore" B. Today, Bitcoin Core uses the Orphan Pool (managed alongside the mempool) to hold these "Parentless" transactions in a temporary waiting area.
For the Sovereign Architect, the Orphan Pool is the "Patience of the Historian." It is the proof that your node can hold onto a "Fragment of the Truth" while waiting for the context to arrive.
Analyzing the Waiting Area: mapOrphanTransactions
In the source code, we see how the node stores these "Incomplete" stories.
/**
* PEDAGOGICAL ANALYSIS: THE ORPHANAGE
* This logic saves transactions that are "Valid but
* Incomplete" until their parents arrive.
*/
void PeerManagerImpl::ProcessOrphanTx(NodeId nodeid, const CTransactionRef& ptx)
{
// 1. Identify the "Missing Parents".
// 2. Put the transaction into mapOrphanTransactions.
// 3. Ask the peer who sent it: "Where are the parents?"
}
Explaining the Waiting Area: The Missing Link
-
"The 100-Orphan Limit": Orphans are dangerous because you haven't verified their parents yet. To prevent an attacker from filling your RAM with "Fake Orphans," the node only keeps 100 at a time. It is the Prudence of the Sovereign.
-
"The Triggered Resolution": When a "Standard" transaction arrives in the mempool, the node immediately asks: "Is anyone in the Orphan Pool waiting for this?" If yes, it "Re-validates" the child. It is the Proactivity of the Machine.
-
"The Peer Attribution": The node remembers which peer sent each orphan. If a peer sends thousands of orphans that never get resolved, they are marked as "Suspicious." It is the Accountability of the Protocol.
-
"The Short-Term Memory": Orphans only stay in the pool for 20 minutes. If the parents don't arrive by then, the "Child" is deleted. The node has "Limited Patience" for incomplete stories. It is the Efficiency of the Core.
The Sovereignty of the Waiting Area
The Orphan Pool allows your node to be "Flexible" in an unpredictable network. It ensures that a single lost packet doesn't break the "Economic Chain." As a Sovereign Architect, you know that "The truth arrives in pieces." By maintaining a safe place for orphans, you are ensuring your node's "Final Picture" of the market is always complete. You are the "Master of the Waiting Area."
TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation: