#include "kernel.h"
#include "coincontrol.h"
#include <boost/algorithm/string/replace.hpp>
+#include <openssl/bio.h>
#include "main.h"
return true;
}
+bool CWallet::GetPEM(const CKeyID &keyID, const std::string &fileName, const SecureString &strPassKey) const
+{
+ BIO *pemOut = BIO_new_file(fileName.c_str(), "w");
+ if (pemOut == NULL)
+ return error("GetPEM() : failed to create file %s\n", fileName.c_str());
+ CKey key;
+ if (!GetKey(keyID, key))
+ return error("GetPEM() : failed to get key for address=%s\n", CBitcoinAddress(keyID).ToString().c_str());
+ bool result = key.WritePEM(pemOut, strPassKey);
+ BIO_free(pemOut);
+ return result;
+}
+
int64_t CWallet::IncOrderPosNext(CWalletDB *pwalletdb)
{
int64_t nRet = nOrderPosNext++;
list<pair<CBitcoinAddress, int64_t> > listSent;
GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount, filter);
- if (strAccount == "")
+ if (strAccount.empty())
nGenerated = allGeneratedMature;
if (strAccount == strSentAccount)
{