This commit is contained in:
jed
2011-10-14 11:39:06 -07:00
commit a8e8613475
112 changed files with 25368 additions and 0 deletions

44
Wallet.h Normal file
View File

@@ -0,0 +1,44 @@
#ifndef __WALLET__
#define __WALLET__
#include "keystore.h"
#include "newcoin.pb.h"
#include <list>
#include <vector>
class NewcoinAddress;
/*
Keeps track of all the public/private keys you have created
*/
class Wallet : public CBasicKeyStore
{
class Account
{
public:
//CKey mKey;
std::string mAddress;
//std::vector<unsigned char> mPublicKey;
//std::vector<unsigned char> mPrivateKey;
uint64 mAmount;
uint64 mAge;
Account(){}
};
std::list<Account> mYourAccounts;
bool signTransInput(uint256 hash, newcoin::TransInput& input,std::vector<unsigned char>& retSig);
uint256 calcTransactionHash(newcoin::Transaction& trans);
bool createTransaction(NewcoinAddress& destAddress, uint64 amount,newcoin::Transaction& trans);
bool commitTransaction(newcoin::Transaction& trans);
public:
Wallet();
void load();
uint64 getBalance();
// returns some human error str?
std::string sendMoneyToAddress(NewcoinAddress& destAddress, uint64 amount);
};
#endif