{
unsigned char *envelope_key = NULL, *output = NULL;
- if (!ctx || !cryptogram || !length || !error) {
+ if (!ctx || !cryptogram || !length) {
SET_ERROR("Invalid argument");
goto err;
}
printf("Startup time: %s\n", DateTimeStrFormat("%x %H:%M:%S", GetTime()).c_str());
printf("Default data directory %s\n", GetDefaultDataDir().string().c_str());
printf("Used data directory %s\n", strDataDir.c_str());
- std::ostringstream strErrors;
if (fDaemon)
fprintf(stdout, "NovaCoin server starting\n");
NewThread(ThreadScriptCheck, NULL);
}
- int64_t nStart;
-
// ********************************************************* Step 5: verify database integrity
uiInterface.InitMessage(_("Verifying database integrity..."));
printf("Loading block index...\n");
bool fLoaded = false;
+ int64_t nStart;
while (!fLoaded) {
std::string strLoadError;
uiInterface.InitMessage(_("Loading block index..."));
for (auto mi = mapBlockIndex.begin(); mi != mapBlockIndex.end(); ++mi)
{
auto hash = (*mi).first;
- if (strncmp(hash.ToString().c_str(), strMatch.c_str(), strMatch.size()) == 0)
+ if (strMatch.compare(hash.ToString()) == 0)
{
auto pindex = (*mi).second;
CBlock block;
uiInterface.InitMessage(_("Loading wallet..."));
printf("Loading wallet...\n");
nStart = GetTimeMillis();
+ std::ostringstream strErrors;
bool fFirstRun = true;
pwalletMain = new CWallet(strWalletFileName);
DBErrors nLoadWalletRet = pwalletMain->LoadWallet(fFirstRun);
iterator insert(iterator it, const char& x=char()) { return vch.insert(it, x); }
void insert(iterator it, size_type n, const char& x) { vch.insert(it, n, x); }
- void insert(iterator it, const_iterator first, const_iterator last)
- {
- assert(last - first >= 0);
- if (it == vch.begin() + nReadPos && (unsigned int)(last - first) <= nReadPos)
- {
- // special case for inserting at the front when there's room
- nReadPos -= (unsigned int)(last - first);
- memcpy(&vch[nReadPos], &first[0], last - first);
- }
- else
- vch.insert(it, first, last);
- }
-
-#ifndef _MSC_VER
void insert(iterator it, std::vector<char>::const_iterator first, std::vector<char>::const_iterator last)
{
assert(last - first >= 0);
else
vch.insert(it, first, last);
}
-#endif
void insert(iterator it, const char* first, const char* last)
{
*/
inline std::string _(const char* psz)
{
- boost::optional<std::string> rv = uiInterface.Translate(psz);
- return rv ? (*rv) : psz;
+ try {
+ boost::optional<std::string> rv = uiInterface.Translate(psz);
+ return rv ? (*rv) : psz;
+ }
+ catch (const boost::bad_function_call& e) {
+ printf("Warning: %s in %s:%d\n", e.what(), __FILE__, __LINE__);
+ return psz;
+ }
}
#endif