bitcoin/bitcoin — pull request #3426 by laanwj (2013-12-16 16:35:24+00:00)
Title: Don't create empty transactions when reading corrupted wallet

The current transaction loading code is not exception safe. An exception during deserialization causes an empty transaction to be left behind in the wallet.

Fix this by building the transaction separately and adding it only to the wallet at the end.

Fixes #3333.