// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#include "txdb-leveldb.h"
#include "wallet.h"
-#include "walletdb.h"
-#include "crypter.h"
-#include "interface.h"
+#include "txdb-leveldb.h"
#include "base58.h"
-#include "kernel.h"
#include "coincontrol.h"
-#include "main.h"
+#include "crypter.h"
+#include "kernel.h"
+#include "walletdb.h"
#include <openssl/bio.h>
return true;
}
+bool CWallet::LoadCryptedKey(const CPubKey &vchPubKey, const std::vector<unsigned char> &vchCryptedSecret) { SetMinVersion(FEATURE_WALLETCRYPT); return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret); }
+
bool CWallet::AddCryptedKey(const CPubKey &vchPubKey, const vector<unsigned char> &vchCryptedSecret)
{
if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
return true;
}
+bool CWallet::LoadKey(const CMalleableKeyView &keyView, const CSecret &vchSecretH) { return CCryptoKeyStore::AddMalleableKey(keyView, vchSecretH); }
+
+bool CWallet::LoadCryptedKey(const CMalleableKeyView &keyView, const std::vector<unsigned char> &vchCryptedSecretH) { return CCryptoKeyStore::AddCryptedMalleableKey(keyView, vchCryptedSecretH); }
+
+bool CWallet::LoadMinVersion(int nVersion) { nWalletVersion = nVersion; nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion); return true; }
+
bool CWallet::AddCScript(const CScript& redeemScript)
{
if (!CCryptoKeyStore::AddCScript(redeemScript))
}
}
+bool CWalletTx::IsFromMe(const isminefilter &filter) const
+{
+ return (GetDebit(filter) > 0);
+}
+
void CWalletTx::AddSupportingTransactions(CTxDB& txdb)
{
vtxPrev.clear();
}
+CWalletTx::CWalletTx()
+{
+ Init(nullptr);
+}
+
+CWalletTx::CWalletTx(const CWallet *pwalletIn)
+{
+ Init(pwalletIn);
+}
+
+CWalletTx::CWalletTx(const CWallet *pwalletIn, const CMerkleTx &txIn) : CMerkleTx(txIn)
+{
+ Init(pwalletIn);
+}
+
+CWalletTx::CWalletTx(const CWallet *pwalletIn, const CTransaction &txIn) : CMerkleTx(txIn)
+{
+ Init(pwalletIn);
+}
+
void CWalletTx::Init(const CWallet *pwalletIn)
{
pwallet = pwalletIn;