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)
Make qa/rpc-tests/ compatible with OSX

Reworked send.sh, so it works properly on my Mac (killall send.sh
doesn't work, because the process name is 'bash' not 'send.sh').
So now send.sh writes a .send.pid file, and invoking it as
send.sh -STOP (as the bitcoind -walletnotify) signals that PID.
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)
Make qa/rpc-tests/ compatible with OSX

Reworked send.sh, so it works properly on my Mac (killall send.sh
doesn't work, because the process name is 'bash' not 'send.sh').
So now send.sh writes a .send.pid file, and invoking it as
send.sh -STOP (as the bitcoind -walletnotify) signals that PID.
Merge pull request #3667 from gavinandresen/rpctest_osxcompat

Make qa/rpc-tests/ compatible with OSX
Handle "conflicted" transactions properly

Extend CMerkleTx::GetDepthInMainChain with the concept of
a "conflicted" transaction-- a transaction generated by the wallet
that is not in the main chain or in the mempool, and, therefore,
will likely never be confirmed.

GetDepthInMainChain() now returns -1 for conflicted transactions
(0 for unconfirmed-but-in-the-mempool, and >1 for confirmed).

This makes getbalance, getbalance '*', and listunspent all agree when there are
mutated transactions in the wallet.

Before:
 listunspent: one 49BTC output
 getbalance: 96 BTC (change counted twice)
 getbalance '*': 46 BTC (spends counted twice)

After: all agree, 49 BTC available to spend.
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.
Merge pull request #3659 from jgarzik/zapall

Add -zapwallettx function, a diagnostic tool to assist in wallet repair
qt: GUI for conflicted transactions

- Exclamation mark icon for conflicted transactions
- Show mouseover status for conflicted transactions as "conflicted"
- Don't show inactive transactions on overview page overview
Merge pull request #3669 from gavinandresen/dead_txns

Handle "conflicted" transactions properly
Track and report wallet transaction clones

Adds a "walletconflicts" array to transaction info; if
a wallet transaction is mutated, the alternate transaction id
or ids are reported there (usually the array will be empty).

Metadata from the original transaction is copied to the mutant,
so the transaction time and "from" account of the mutant are
reported correctly.
Merge pull request #3671 from gavinandresen/txn_conflicts

Report transaction conflicts, and tentative account balance fix
qt: Add option to (not) spend unconfirmed change

- Add a wallet tab to options dialog
- Move fee setting to wallet tab
- Add new setting to set -nospendzeroconfchange from UI
Merge pull request #3676

29d4507 qt: Add option to (not) spend unconfirmed change (Wladimir J. van der Laan)