https://travis-ci.org/github/bitcoin/bitcoin/jobs/679885530#L8791
{
    const auto& ins = mapWallet.emplace(std::piecewise_construct, std::forward_as_tuple(hash), std::forward_as_tuple(this, nullptr));
    CWalletTx& wtx = ins.first->second;
    if (!fill_wtx(wtx, ins.second)) {
        return false;
    }
    
    if (HaveChain()) {
        bool active;
        int height;
        if (chain().findBlock(wtx.m_confirm.hashBlock, FoundBlock().inActiveChain(active).height(height)) && active) {
            
            
            wtx.m_confirm.block_height = height;
        } else if (wtx.isConflicted() || wtx.isConfirmed()) {
            
            
            
            
            
            
            wtx.setUnconfirmed();
            wtx.m_confirm.hashBlock = uint256();
            wtx.m_confirm.block_height = 0;
            wtx.m_confirm.nIndex = 0;
        }
    }
    if ( ins.second) {