For the work I am currently doing I need similar functionality as Bittorrent, only difference is I need to do some sort of extra analysis on every block received by client from peers. Though I am fairly new with Python, I found official Bittorrent client source code easy to understand (as compared to Transmission's C source code). But I can't seem to figure out the part in the source code where it deals/handles every block received.
It'd be great if anyone, who is acquainted with Bittorrent official client source code (or Transmission), can provide me some pointers for the same.
For Transmission, try looking at libtransmission/peer-mgr.c for code specific to each type of message received from a particular peer. This file represents the peer manager and all communication with it.
It uses libtransmission/peer-msgs.c for handling the exact messages.
Block handling in bittorent