~ubuntu-branches/ubuntu/utopic/bitcoin/utopic

« back to all changes in this revision

Viewing changes to src/keystore.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard, Jonas Smedegaard, Jan Dittberner
  • Date: 2011-07-19 15:08:54 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110719150854-mhd8cclbbfrkhi1u
Tags: 0.3.24~dfsg-1
* New upstream release.

[ Jonas Smedegaard ]
* Improve various usage hints:
  + Explicitly mention in long description that bitcoind contains
    daemon and command-line interface.
  + Extend README.Debian with section on lack of GUI, and add primary
    headline.
  + Avoid installing upstream README: contains no parts relevant for
    Debian usage.
  Thanks to richard for suggestions (see bug#629443).
* Favor final releases over prereleases in rules and watch file.
  Thanks to Jan Dittberner.
* Track -src (not -linux) tarballs in rules and watch file.
  Thanks to Jan Dittberner.
* Drop patches 1004 and 1005 (integrated upstream) and simplify
  CXXFLAGS in rules file.
* Stop stripping no longer included source-less binaries from upstream
  tarballs.

[ Jan Dittberner ]
* refresh debian/patches/1000_use_system_crypto++.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) 2009-2011 Satoshi Nakamoto & Bitcoin developers
 
2
// Distributed under the MIT/X11 software license, see the accompanying
 
3
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
 
4
 
 
5
#include "headers.h"
 
6
#include "db.h"
 
7
 
 
8
 
 
9
 
 
10
//////////////////////////////////////////////////////////////////////////////
 
11
//
 
12
// mapKeys
 
13
//
 
14
 
 
15
std::vector<unsigned char> CKeyStore::GenerateNewKey()
 
16
{
 
17
    RandAddSeedPerfmon();
 
18
    CKey key;
 
19
    key.MakeNewKey();
 
20
    if (!AddKey(key))
 
21
        throw std::runtime_error("GenerateNewKey() : AddKey failed");
 
22
    return key.GetPubKey();
 
23
}
 
24
 
 
25
bool CKeyStore::AddKey(const CKey& key)
 
26
{
 
27
    CRITICAL_BLOCK(cs_mapKeys)
 
28
    {
 
29
        mapKeys[key.GetPubKey()] = key.GetPrivKey();
 
30
        mapPubKeys[Hash160(key.GetPubKey())] = key.GetPubKey();
 
31
    }
 
32
}
 
33