I noticed there is a problem with dumpwallet option. It does not seem to dump segwit addresses ("3"), and dumps only the standard one ("1"). Is it a bug or work as intended? How can I perform full dump of an wallet then?
continue;
            }
            pwallet->mapKeyMetadata[keyid].nCreateTime = nTime;
            if (fLabel)
                pwallet->SetAddressBook(keyid, strLabel, "receive");
            nTimeBegin = std::min(nTimeBegin, nTime);
        } else if(IsHex(vstr[0])) {
           std::vector<unsigned char> vData(ParseHex(vstr[0]));
           CScript script = CScript(vData.begin(), vData.end());
           if (pwallet->HaveCScript(script)) {
               LogPrintf("Skipping import of %s (script already present)\n", vstr[0]);
               continue;
           }
           if(!pwallet->AddCScript(script)) {
               LogPrintf("Error importing script %s\n", vstr[0]);
               fGood = false;
               continue;
           }
        }
    }
    file.close();
    pwallet->ShowProgress("", 100); 
    pwallet->UpdateTimeFirstKey(nTimeBegin);
    pwallet->RescanFromTime(nTimeBegin, false );
    pwallet->MarkDirty();
    if (!fGood)
        throw JSONRPCError(RPC_WALLET_ERROR, "Error adding some keys/scripts to wallet");
    return NullUniValue;
}
UniValue dumpprivkey(const JSONRPCRequest& request)