Do not store merkle branches inside the wallet. This means removing the check that someone might have inserted an unconfirmed transaction in your wallet and making it look like a confirmed one.
This means we don’t need to keep the merkle branch in wallets (which takes up to half a kilobyte per transactions), we don’t need to validate it (which requires a dozen sha256 operation per wallet transaction), remove the need to keep the merkle tree in blocks (the case where it’s needed is done separately in CPartialMerkleTree), and simplifies the merkle root computation.
This may be controversial, as it weakens the security assumption slightly, but simplifies the code.