I think the operation of subtracting each farmer’s points should be put until the transaction is completed. otherwise, if the program exits unexpectedly, the subtraction of each farmer’s score may be successful, but the transaction fails. If the program is restarted, all farmers’ points are already 0.