mirror of
https://github.com/XRPLF/rippled.git
synced 2026-09-28 07:48:01 +00:00
SHAMap::addKnownNode() now reports invalid() for the two node shapes it refuses to hook in: an inner node at kLeafDepth (a depth only a leaf may occupy) and a node whose ID doesn't match where the descent stopped. Both already read as bad data to callers, so neither counted as progress before. No peer can satisfy a hash that reaches either shape, so retrying is futile; the charge is a deterrent rather than a control, since the same node can reach a map through a fetch pack or unsolicited object reply with no peer to charge. The depth check runs before the full-below cache lookup, since that cache is keyed by hash (which doesn't cover depth) and shared across every map in the family - checking depth first keeps the verdict independent of what an unrelated map cached.