Shama-il Tirmidhi Chapter 039, Hadith Number 001 (248).

Mughirah bin Shu'bah Radiyallahu 'Anhu reports that Rasuluilah Sallallahu 'Alayhi Wasallam performed such lengthy nafl prayers, that his mubaarak legs became swollen. The Sahaabah said : "You undergo such great difficulties, where Allah had forgiven your past and the future sins. "Rasulullah Sallallahu 'Alayhi Wasallam said: "(When Allah Ta'aala has blessed me so much) should I not be a grateful servant?"

Commentary
Apparently the questioner thought that prayers are for the forgiveness of sins. When Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam is sinless, how could he commit sin? Why should he voluntarily undergo such difficulties? Sayydina Rasulullah Sallallahu 'Alayhi Wasallam replied the object of worship is not only this, but has several reasons. When Allah Ta'aala has forgiven all my sins, then the correct and most appropriate thing is that I constantly worship Him and thank Him for His grace and blessings.Sayyidina 'Ali Radiyallahu 'Anhu says: "Ibaadah is something performed because the object is Jannah, that is a businessman's 'ibaadah. The 'ibaadah is meant for purchasing. The price is paid here and the articles obtained there. Sometimes 'ibaadah is because of fear this is a slave's 'ibaadah. Ibaadah is performed for fear of punishment, as is the custom of the servant. One 'ibaadah is that which is performed without any future need or fear. It is solely for the gratitude of Allah's abudant blessings".

It is mentioned in the above hadith that Allah Ta'aala has forgiven all the sins of Sayydina Rasullullah Sallallahu 'Alayhi Wasallam. A doubt may arise here, that he committed a sin, but Allah Ta'aala forgave him. Whereas all the Ambiyaa (prophets) are sinless. They do not commit sins. The 'ulama have given many answers to this question, which are mentioned in their respective places. Especially many answers have been given in tafseer (commentary) Sura Fath. According to this Humble servant the easiest is: The deeds of the pious are regarded as a sin for the near one's to Allah. One commits a sin according to one's status. According to the status of Sayydina Rasulullah Sallallahu 'Alayhi Wasallam, that which is considered to be shortcoming, is of such a nature, that for the rest of us they are the very essence of devotion. As an example: Sayydina Rasulullah Sallallahu 'Alayhi Wasallam was conferring with the leaders of the kuffar (non believers) in the hope that they might except Islaam. Which in essence is the core of the deen. At that moment a blind Sahaabi, Sayydina Ibn Ummi Maktum Radiyallahu 'Anhu came to Sayyidina Rasulullah Sallallahu 'Alayhi Wasallamand said something. Due to the importance of the discussion, Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam felt annoyed at the Sahaabi's intrusion. On that Allah Ta'aala admonished Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam in the Sura of 'Abas. In the same manner after the Battle of Badr, Sayyidina Rasulullah Sallallhu 'Alayhi Wasallam treated the prisoners of war with great kindness and mercy, in the hope that they would accept Islaam, or their offspring would accept Islaam. He took fidyah (ransom) from them and freed them. He was cautioned in the Qur-aan on this. These are such cases, which due to high rank of Sayyidina Rasulullah Sallallahu 'Alayhi Wasallam, are regarded as shortcomings.