Bitcoin builds upon an unstructured peer-to-peer overlay network to disseminate transactions and blocks. Broadcast in such a network is slow and brings inconsistencies, i.e. peers have different views of the system state. Due to the delayed block propagation and the competition of mining, forking, i.e. the blockchain temporarily diverges into two or more branches, occurs, which wastes computation power and causes security issues. This paper proposes an autonomous and distributed topology optimization mechanism to reduce block propagation delay and hence reduce the occurrence of blockchain forks. In the proposed mechanism, a node can autonomously update his neighbor set using the information provided by his current neighbors, since each neighbor will recommend a peer from his own neighbor set, i.e. a neighbor’s neighbor, to this node. Each recommendation is based on a peer’s propagation ability, which is characterized as a criteria function obtained through a combination of empirical analysis and machine learning. We further propose some metrics to evaluate a Bitcoin network topology. Experiment results reflect the effectiveness of the proposed mechanism and indicate the correlation between block propagation time and fork rate. Thus, we analyze the relation between block propagation time and fork rate by applying an epidemic model to capture the block propagation process. We prove that a Bitcoin network topology with a relatively small network delay variance among all nodes produces a lower fork rate than another topology if its average block propagation time to 84% of the entire network is shorter.