In blockchain-based unmanned aerial vehicle (UAV) communication systems, the length of a block affects the performance of the blockchain. The transmission performance of blocks in the form of finite character segments is also affected by the block length. Therefore, it is crucial to balance the transmission performance and blockchain performance of blockchain communication systems, especially in wireless environments involving UAVs. This paper investigates a secure transmission scheme for blocks in blockchain-based UAV communication systems to prevent the information contained in blocks from being completely eavesdropped during transmission. In our scheme, using a friendly jamming UAV to emit jamming signals diminishes the quality of the eavesdropping channel, thus enhancing the communication security performance of the source UAV. Under the constraints of maneuverability and transmission power of the UAV, the joint design of UAV trajectories, transmission power, and block length are proposed to maximize the average minimum secrecy rate (AMSR). Since the optimization problem is non-convex and difficult to solve directly, we first decompose the optimization problem into subproblems of trajectory optimization, transmission power optimization, and block length optimization. Then, based on first- order approximation techniques, these subproblems are reformulated as convex optimization problems. Finally, we utilize an alternating iteration algorithm based on the successive convex approximation (SCA) technique to solve these subproblems iteratively. The simulation results demonstrate that our proposed scheme can achieve secure transmission for blocks while maintaining the performance of the blockchain.