Look at it this way:
The United States will never tolerate having a repeat of North Korea. That's a reason why Libya got bumped off, and why the USA looks the other way at Israel bombing Syria. Iran is different: they don't have any great power/superpower backers, unlike North Korea with China. In Iranian leaders' eyes, they have no guarantee that they have the time to develop nuclear weapons before they're struck first by the Americans and Israelis, which may or may not be nuclear in nature. If they have very low chances of building a successful nuclear weapons program, and doing so will have a very high (nigh guaranteed) of being bombed, then the best thing they could do is to make peace and to trust Washington to not go back on their word.
As far as the latter, Trump is actually quite anti-war, and nowhere near as neo-conish as people like Bush and Bolton. He's even fired his NSA for being too pro-Israel. If the USA does go back on their word, it will likely be in the form of resumed sanctions, not bombing, while Trump is in office.