President Trump has made a lot of hay about currency manipulators, particularly China, during and even after the presidential campaign.

The reality is that very few countries are currently manipulating their currencies. But not so long ago, they were, and they caused a lot of damage.

Brad Setser, a senior fellow at the Council on Foreign Relations, first started to notice this in 2004.

“I was looking at the reported foreign exchange reserves of different Asian countries, particularly China,” he recalled.

These kinds of reserves are, in moderation, pretty normal. They’re just a country’s stockpile of other countries’ money. The U.S. central bank has lots of euros, the Europeans have lots of yen. You might still have pesos from your trip to Mexico.

“China started the decade of the 2000s with about 250 billion [U.S. dollars’ worth of] reserves, and it was sort of steadily heading up,” Setser said. Five hundred billion, 700 billion. “And then it went above a trillion.”

In the first decade of the 2000s, China wasn’t just hanging on to a few dollars — it was starting to hoard them, trillions of them. It would eventually peak at $4 trillion. Where were these dollars coming from? What was China up to?

“It did worry me at the time,” Setser said. “We’d never seen that kind of reserve accumulation in an economy.”

Part of it was the fact that the U.S. was starting to buy a lot of Chinese goods, so dollars were flowing there. But something else was happening.

“China was very consistently going into the market and buying U.S. dollars,” he said.

China was buying up dollars to artificially bid up the price of the dollar and make its own currency cheaper. It’s just like someone at an auction house bidding up the price of a painting. The dollar became more expensive, the yuan became cheaper, and that made Chinese exports more competitive. Now, before you go hating on China, just know that this wasn’t entirely evil.

“It’s wrong to say China sort of malevolently decided to do this in 2003 just to hurt the rest of the world,” said Joe Gagnon, senior fellow at the Peterson Institute for International Economics and co-author of “Currency Conflict and Trade Policy.”

He said China was just trying to hold its currency stable, which it had done for many years and which many developing countries do. But as China developed and entered the world of global trade on an unprecedented scale, its currency manipulation started to have real consequences for the U.S.

“It did accelerate this flood of Chinese exports into different industries that caused a lot of job loss,” Gagnon said. He estimates that the U.S. lost more than 300,000 manufacturing jobs as a result of currency manipulation — excluding other factors, like automation and Chinese competitiveness.

He also said China invested a lot of its bought-up dollars in the U.S., indirectly fueling the housing bubble, “so it kind of made the housing bubble bigger and made the crash bigger.”

China was not alone in pushing its currency down. Japan and Korea did this as well, though not on the same scale.

Collectively, currency manipulation was notably bad for the U.S. during and after the recession, essentially kicking the U.S. economy when it was down.

“If there had not been currency manipulation during those years, we would have had a faster recovery and gained another million jobs for several years,” Gagnon said.

But the U.S. didn’t do much about it. The consequences of currency manipulation were slow to become clear, even for many economists. And politically, the U.S. didn’t and doesn’t have very strong tools at its disposal.

In 2015, Congress passed legislation requiring the Treasury to monitor currency manipulation. But penalties are limited, said the CFR’s Setser.

The law says “the U.S. government wouldn’t buy products directly from the country that is believed to be acting inappropriately in the foreign exchange market, the U.S. would not enter into new free trade agreements or it would be a factor in that decision. The U.S. wouldn’t offer insurance for U.S. companies making investments in the country that is acting inappropriately,” Setser said. “But what it doesn’t do is explicitly authorize a counter intervention.”

Counter intervention is exactly what is needed, Gagnon said.

“If countries are distorting currency values by buying lots of dollars, we’re going to buy an equal amount of your currency back,” he said.

In other words, if someone messes with U.S. currency, the U.S. messes with theirs. It’s something the U.S. has been reluctant to do for fear of starting currency wars, and historically, policymakers have been reluctant to “stoop” to a behavior they try to discourage in other countries. It would also require an act of Congress. But Gagnon said the U.S. needs something with teeth to deal with currency manipulation.

“It’s a war in which people were firing at us and we never fired back.”

About four years ago, many countries, including China, stopped manipulating their currencies. The war that Gagnon talks about has died down, for now. But he has a warning: Don’t be defenseless the next time it starts up.