Large performance improvement when adding transactions if the client is not currently at the tip of the blockchain. This particularly improves wallet rescan times, including following from a zapwallettxes.
In AddToWallet, two large indices are created over the wallet in order to make an estimate of the time a wallet transaction was created. This is slow anyway (possibly subject to a further fix) but also unnecessary if we are not at the tip because we just default to the block time. This patch skips the rescan code if we were going to fall back to the block time anyway, so shouldn't change the logic.
On a wallet with around 180,000 keys (500 MB, so pretty large) this sped up the resync time 20x from about 10 hours to 30 minutes.