added some sanity checks in p2p transaction handling