The Messenger of Allah ﷺ said, "When a man purifies himself and then proceeds to the mosque awaiting the prayer, his recording angel, or his two recording angels, writes for him ten good deeds for every step he takes toward the mosque. The one sitting awaiting the prayer is like one in devout worship, and he is counted among those praying from the moment he leaves his home until he returns."
عن رسول الله ﷺ قال: إذا تطهر الرجل ثم مر إلى المسجد يرعى الصلاة كتب له كاتبه- أو كاتباه- بكل خطوة يخطوها إلى المسجد عشر حسنات، والقاعد يرعى الصلاة كالقانت، ويكتب من المصلين من حيث يخرج من بيته حتى يرجع.
Tabarani related it in Al-Kabir (17/301), Ibn Khuzayma (1492), and Ibn Hibban (2038, 2045), and Hakim in Al-Mustadrak (1/211), all of them via the route of Abdullah bin Wahb, who said, Amr bin Harith informed me, from Abu Ushana, that he heard Uqba bin Amir Juhani narrating from the Messenger of Allah ﷺ, and he mentioned the same, and the wording is Ibn Khuzayma's. Hakim said, "Sahih according to the criterion of Muslim."Imam Ahmad also related it (17440, 17459, 17460, 17461) through routes from Ibn Lahia, from Abu Ushana, with the same wording. There is well-known discussion regarding Ibn Lahia, but in his last route Ibn Mubarak narrates from him, and his hearing from him is early, and his narration from him is sahih. The hadith appears in his Zuhd (410), where he said, Ibn Lahia informed us, saying, Abu Qabil told me, from Abu Ushana Maafiri, with the same wording.Abu Qabil is Huyayy bin Hani Maafiri. Ahmad, Ibn Main, and Abu Zura said he is trustworthy. So Ibn Lahia sometimes narrates from Abu Qabil, from Abu Ushana, with an intermediary, and at other times from Abu Ushana directly, and in some narrations from Amr bin Harith, from Abu Ushana. I do not know whether this stems from his confusion, or whether he first used to narrate with an intermediary and then was able to hear it without an intermediary, all of which is possible. In any case, the hadith is sahih without him.Uqba bin Amir has another hadith, through the route of Abdullah bin Wahb, concerning the reward of purification and the encouragement to perform night prayer.