We present a comparative analysis of superconducting and charge-density-wave orders in the spinfluctuation scenario for the cuprates. That spin-fluctuation exchange gives rise to d-wave superconductivity is well known. Several groups recently argued that the same spin-mediated interaction may also account for charge-density-wave order with momenta (Q, 0) or (0, Q), detected in underdoped cuprates. This has been questioned on the basis that charge-density-wave channel mixes fermions from both nested and anti-nested regions on the Fermi surface, and fermions in the anti-nested region do not have a natural tendency to form a bound state, even if the interaction is attractive. We show that anti-nesting is not an obstacle for charge order, but to see this one needs to go beyond the conventional Eliashberg approximation. We show that in the prefect nesting/antinesting case, when the velocities of hot fermions are either parallel or antiparallel, the onset temperatures in superconducting and charge-density-wave channels are of comparable strength for any magnetic correlation length ξ. The superconducting Tsc is larger than T cdw , but only numerically. When the velocities of hot fermions are not strictly parallel/antiparallel, T cdw progressively decreases as ξ decreases and vanishes at some critical ξ.