No need to convert to a CBitcoinAddress. Use CKeyID *pkeyid = boost::get<CKeyID>(&address), which results in NULL or a pointer to a valid CKeyID.