anchor.diff:                  pings = gb_trees:empty()}).
   
   start_link() ->
  -    ensure_tab(?RECV_POOL, [set, public, named_table]),
  -    case gen_server:start_link({local, ?MODULE}, ?MODULE, [], []) of
  -        {ok, Pid} ->
  -            ets:give_away(?RECV_POOL, Pid, []),
  -            {ok, Pid};
  -        Other ->
  -            Other
  -    end.
  +    gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
   
   init([]) ->
       Peers = application:get_env(aecore, peers, []),
  
positive.code:     jobs:enqueue(sync_jobs, {start_sync, PeerUri}),
      {noreply, State};
  handle_cast({received_block, Block}, State) ->
      HdrHash = header_hash(Block),
      case aec_chain:get_block_by_hash(HdrHash) of
          {ok, _} ->
              %% we have the block; do not re-send
              {noreply, State};
          {error, _} ->
              cache_and_queue_block(HdrHash, Block, received, forward, State),
              {noreply, State}
      end;
  handle_cast({block_created, Block}, State) ->
      HdrHash = header_hash(Block),
      cache_and_queue_block(HdrHash, Block, created, forward, State),
      publish(block_created, aec_blocks:height(Block)),
      {noreply, State};
  handle_cast(_, State) ->
  
negative.code: process_job([{T, Job}]) ->
      reg_worker(Job, T),
      case Job of
          {forward, #{block := Block}, Peer} ->
              do_forward_block(Block, Peer);
          {start_sync, PeerUri} ->
              do_start_sync(PeerUri);
          _Other ->
              lager:debug("unknown job", [])
      end.
  
  queue_block(Block, Status, Op, State) ->
      case aec_peers:get_random(State#state.subset_size) of
          [] ->
              ok;
          [_|_] = Peers ->
              [enqueue_recv({Op, #{status => Status,
                                   block  => Block}, Peer})
               || Peer <- Peers]
      end.
  
  enqueue_recv(Job) ->
      jobs:enqueue(sync_jobs, Job).
  
  do_forward_block(Block, Peer) ->
      Res = aeu_requests:send_block(Peer, Block),
      lager:debug("send_block Res (~p): ~p", [Peer, Res]).
  
  do_start_sync(PeerUri) ->
      fetch_headers(PeerUri, genesis_hash(), []).
  