Self-organization is a fundamental property of P2P networks. The local views of the nodes which are managed in self-organization mode make the corresponding trust model hard to establish. Current trust models based on global reputation by using the iterative method have high time complexity and excessive incurred packets, thus limiting the scalability when applied to P2P networks. A novel trust model, named RGTrust, based on repeated game theory is given in the paper. Under the assumption that individual peers are rational and selfish, the mechanism of RGTrust is described in details. P2P networks using RGTrust scheme have a good performance and stability. Furthermore, compared with other types of trust model, RGTrust yields both lower time complexity and fewer incurred packets. Simulations have also verified the conclusion.