Skip to content

strCommand == "tx": ignore until initial block download is complete #597

@dmgores

Description

@dmgores

strCommand == "tx": ignore until initial block download is complete.

Why? No need to process new transactions that would go in the new block that is being generated when you do not have the entire chain. This would save some CPU cycles and some debug log length.

In my suggested change (C#), I add the initial block download check after adding the CInv to the node's inventory:

            CInv inv = new CInv(ppszTypeName.tx, tx.GetHash());
            pfrom.AddInventoryKnown(inv);

+ if (CBlock.IsInitialBlockDownload() || CTransaction.IsOrphanTX(tx.GetHash()))

  •                return true;
    
            bool fMissingInputs = false;
            if (tx.AcceptToMemoryPool(true, ref fMissingInputs))...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions