コード例 #1
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteWatchOnly(const CScript &dest, const CKeyMetadata& keyMeta)
{
    if (!WriteIC(std::make_pair(std::string("watchmeta"), dest), keyMeta)) {
        return false;
    }
    return WriteIC(std::make_pair(std::string("watchs"), dest), '1');
}
コード例 #2
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteKey(const CPubKey& vchPubKey, const CPrivKey& vchPrivKey, const CKeyMetadata& keyMeta)
{
    if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta, false)) {
        return false;
    }

    // hash pubkey/privkey to accelerate wallet load
    std::vector<unsigned char> vchKey;
    vchKey.reserve(vchPubKey.size() + vchPrivKey.size());
    vchKey.insert(vchKey.end(), vchPubKey.begin(), vchPubKey.end());
    vchKey.insert(vchKey.end(), vchPrivKey.begin(), vchPrivKey.end());

    return WriteIC(std::make_pair(std::string("key"), vchPubKey), std::make_pair(vchPrivKey, Hash(vchKey.begin(), vchKey.end())), false);
}
コード例 #3
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteCryptedKey(const CPubKey& vchPubKey,
                                const std::vector<unsigned char>& vchCryptedSecret,
                                const CKeyMetadata &keyMeta)
{
    if (!WriteIC(std::make_pair(std::string("keymeta"), vchPubKey), keyMeta)) {
        return false;
    }

    if (!WriteIC(std::make_pair(std::string("ckey"), vchPubKey), vchCryptedSecret, false)) {
        return false;
    }
    EraseIC(std::make_pair(std::string("key"), vchPubKey));
    EraseIC(std::make_pair(std::string("wkey"), vchPubKey));
    return true;
}
コード例 #4
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteOfflineXPubKey(const CExtPubKey& offline_xpub)
{
    std::vector<unsigned char> vxpub;
    vxpub.resize(BIP32_EXTKEY_SIZE);
    offline_xpub.Encode(&vxpub[0]);
    return WriteIC(std::string("offlinexpub"), vxpub);
}
コード例 #5
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteOrderPosNext(int64_t nOrderPosNext)
{
    return WriteIC(std::string("orderposnext"), nOrderPosNext);
}
コード例 #6
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteTx(const CWalletTx& wtx)
{
    return WriteIC(std::make_pair(std::string("tx"), wtx.GetHash()), wtx);
}
コード例 #7
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WritePurpose(const std::string& strAddress, const std::string& strPurpose)
{
    return WriteIC(std::make_pair(std::string("purpose"), strAddress), strPurpose);
}
コード例 #8
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteName(const std::string& strAddress, const std::string& strName)
{
    return WriteIC(std::make_pair(std::string("name"), strAddress), strName);
}
コード例 #9
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteAccountingEntry(const uint64_t nAccEntryNum, const CAccountingEntry& acentry)
{
    return WriteIC(std::make_pair(std::string("acentry"), std::make_pair(acentry.strAccount, nAccEntryNum)), acentry);
}
コード例 #10
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteAccount(const std::string& strAccount, const CAccount& account)
{
    return WriteIC(std::make_pair(std::string("acc"), strAccount), account);
}
コード例 #11
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteCScript(const uint160& hash, const CScript& redeemScript)
{
    return WriteIC(std::make_pair(std::string("cscript"), hash), redeemScript, false);
}
コード例 #12
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteBestBlock(const CBlockLocator& locator)
{
    WriteIC(std::string("bestblock"), CBlockLocator()); // Write empty block locator so versions that require a merkle branch automatically rescan
    return WriteIC(std::string("bestblock_nomerkle"), locator);
}
コード例 #13
0
ファイル: walletdb.cpp プロジェクト: Airche/wificoin
bool CWalletDB::WriteDefaultKey(const CPubKey& vchPubKey)
{
    return WriteIC(std::string("defaultkey"), vchPubKey);
}
コード例 #14
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteSpecificBlindingKey(const uint160& scriptid, const uint256& key) {
    return WriteIC(std::make_pair(std::string("specificblindingkey"), scriptid), key);
}
コード例 #15
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteBlindingDerivationKey(const uint256& key) {
     return WriteIC(std::string("blindingderivationkey"), key);
}
コード例 #16
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteOfflineCounter(int counter)
{
    return WriteIC(std::string("offlinecounter"), counter);
}
コード例 #17
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteOfflineDescriptor(const std::string& offline_desc)
{
    return WriteIC(std::string("offlinedesc"), offline_desc);
}
コード例 #18
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteMasterKey(unsigned int nID, const CMasterKey& kMasterKey)
{
    return WriteIC(std::make_pair(std::string("mkey"), nID), kMasterKey, true);
}
コード例 #19
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WritePool(int64_t nPool, const CKeyPool& keypool)
{
    return WriteIC(std::make_pair(std::string("pool"), nPool), keypool);
}
コード例 #20
0
ファイル: walletdb.cpp プロジェクト: AmesianX/bitcoin
bool CWalletDB::WriteMinVersion(int nVersion)
{
    return WriteIC(std::string("minversion"), nVersion);
}
コード例 #21
0
ファイル: walletdb.cpp プロジェクト: ElementsProject/elements
bool WalletBatch::WriteOnlineKey(const CPubKey& online_key)
{
    return WriteIC(std::string("onlinekey"), online_key);
}