Add option to avoid spending unconfirmed change
Merge pull request #3651

1bbca24 Add option to avoid spending unconfirmed change (Wladimir J. van der Laan)
If requested, actually treat uncomfirmed change as being uncomfirmed

This commit strengthens 1bbca249b202c4802cc2c4d4de4a26e6392b4d92 by updating the CWalletTx::IsConfirmed() function.

If (bSpendZeroConfChange==false), then IsConfirmed() should actually treat unconfirmed change as being unconfirmed.
Rename IsConfirmed to IsTrusted to better match the intended behavior.

This doesn't change the functionality at all.
Merge pull request #3657

fdbc2b1 If requested, actually treat uncomfirmed change as being uncomfirmed (b6393ce9-d324-4fe1-996b-acf82dbc3d53)
Add raw transaction hex to `gettransaction` wallet RPC

This allows getting raw transaction data from the wallet even if the
transaction is no longer in the blockchain / mempool (for example if it
got orphaned due to malleability abuse).
Merge pull request #3668

3a1c20b Add raw transaction hex to `gettransaction` wallet RPC (Wladimir J. van der Laan)
Merge pull request #3662

0542619 Rename IsConfirmed to IsTrusted to better match the intended behavior. (Gregory Maxwell)
Add -zapwallettxes cli/config option, used for wallet recovery

This diagnostic tool removes all "tx" records from the wallet db,
then forces a full rescan, to rebuild "tx" records accurately.