The underlying premise of peer-to-peer (P2P) systems is the trading of digital resources among individual peers to facilitate file sharing, distributed computing, storage, collaborative applications and multimedia streaming. So-called free-riders challenge the foundations of this system by consuming resources from other peers without offering any resources in return, hindering resource exchange among peers. Therefore, immense effort has been invested in discouraging free-riding and overcoming the ill effects of such unfair use of the system. However, previous efforts have all fallen short of effectively addressing free-riding behaviour in P2P networks. This paper proposes a novel approach based on utilising a credit incentive for P2P networks, wherein a grace period is introduced during which free-riders must reimburse resources. In contrast to previous approaches, the proposed system takes into consideration the upload rate of peers and a grace period. The system has been thoroughly tested in a simulated environment, and the results show that the proposed approach effectively mitigates free-riding behaviour. Compared to previous systems, the number of downloads from free-riders decreased while downloads by contributing peers increased. The results also show that under longer grace periods, the number of downloads by fast peers (those reimbursing the system within the grace period) was greater than the number of downloads by slow peers.