public boolean registerPendingBlock(final Block block, final Bytes nodeId) {

    final ImmutablePendingBlock previousValue =
        this.pendingBlocks.putIfAbsent(
            block.getHash(), ImmutablePendingBlock.builder().block(block).nodeId(nodeId).build());
    if (previousValue != null) {
      return false;
    }

    pendingBlocksByParentHash
        .computeIfAbsent(
            block.getHeader().getParentHash(),
            h -> {
              final Set<Hash> set = newSetFromMap(new ConcurrentHashMap<>());
              // Go ahead and add our value at construction, so that we don't set an empty set which
              // could be removed in deregisterPendingBlock
              set.add(block.getHash());
              return set;
            })
        .add(block.getHash());

    return true;
  }
Track the given block.

@param block the block to track
@param nodeId node that sent the block
@return true if the block was added (was not previously present)
ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/state/PendingBlocksManager.java