mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Make these pieces work together.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "Config.h"
|
||||
#include "util/pugixml.hpp"
|
||||
#include "Application.h"
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
|
||||
2
Makefile
2
Makefile
@@ -69,7 +69,7 @@ HEADERS = \
|
||||
|
||||
SRCS= \
|
||||
test.cpp Hanko.cpp Transaction.cpp SHAMap.cpp SHAMapNodes.cpp Serializer.cpp Ledger.cpp \
|
||||
AccountState.cpp
|
||||
AccountState.cpp Wallet.cpp NewcoinAddress.cpp Config.cpp util/pugixml.o
|
||||
|
||||
|
||||
# Application.cpp HttpReply.cpp main.cpp RPCCommands.cpp \
|
||||
|
||||
@@ -59,7 +59,7 @@ NewcoinAddress::NewcoinAddress(const char* pszAddress)
|
||||
SetString(pszAddress);
|
||||
}
|
||||
|
||||
uint160 NewcoinAddress::GetHash160()
|
||||
uint160 NewcoinAddress::GetHash160() const
|
||||
{
|
||||
assert(vchData.size() == 20);
|
||||
uint160 hash160;
|
||||
|
||||
@@ -48,7 +48,7 @@ bool Transaction::sign(LocalAccount& fromLocalAccount)
|
||||
{
|
||||
if( (mAmount==0) || (mSourceLedger==0) || (mAccountTo==0) )
|
||||
return false;
|
||||
if(mAccountFrom!=fromLocalAccount.mAddress)
|
||||
if(mAccountFrom!=fromLocalAccount.mAddress.GetHash160())
|
||||
return false;
|
||||
Serializer::pointer signBuf=getRaw(true);
|
||||
if(!signBuf->makeSignature(mSignature, fromLocalAccount.peekPrivKey()))
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
class UniqueNodeList
|
||||
{
|
||||
// hanko to public key
|
||||
//std::map<uint160,uint512> mUNL;
|
||||
//std::map<uint160, uint256> mUNL;
|
||||
public:
|
||||
//void load();
|
||||
//void save();
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
void removeNode(uint160& hanko);
|
||||
|
||||
// 0- we don't care, 1- we care and is valid, 2-invalid signature
|
||||
int checkValid(newcoin::Validation& valid);
|
||||
// int checkValid(newcoin::Validation& valid);
|
||||
|
||||
void dumpUNL(std::string& retStr);
|
||||
|
||||
|
||||
16
Wallet.cpp
16
Wallet.cpp
@@ -1,11 +1,16 @@
|
||||
#include "Wallet.h"
|
||||
#include "NewcoinAddress.h"
|
||||
#include "Conversion.h"
|
||||
#include "Application.h"
|
||||
#include "LedgerMaster.h"
|
||||
#include <string>
|
||||
#include <boost/foreach.hpp>
|
||||
using namespace std;
|
||||
|
||||
LocalAccount::LocalAccount(bool)
|
||||
{
|
||||
mPrivateKey.MakeNewKey();
|
||||
mPublicKey.SetPubKey(mPrivateKey.GetPubKey());
|
||||
mAddress.SetPubKey(mPublicKey.GetPubKey());
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
Wallet::Wallet()
|
||||
{
|
||||
@@ -170,3 +175,6 @@ bool Wallet::commitTransaction(TransactionPtr trans)
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
8
Wallet.h
8
Wallet.h
@@ -2,9 +2,8 @@
|
||||
#define __WALLET__
|
||||
|
||||
#include "keystore.h"
|
||||
#include "newcoin.pb.h"
|
||||
#include "Transaction.h"
|
||||
#include "Serializer.h"
|
||||
#include "Transaction.h"
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
@@ -18,18 +17,19 @@ class LocalAccount
|
||||
public:
|
||||
//CKey mKey;
|
||||
//std::string mHumanAddress;
|
||||
uint160 mAddress;
|
||||
NewcoinAddress mAddress;
|
||||
CKey mPublicKey, mPrivateKey;
|
||||
int64 mAmount;
|
||||
uint32 mSeqNum;
|
||||
|
||||
LocalAccount(bool); // create a new local acount
|
||||
bool signRaw(Serializer::pointer);
|
||||
bool signRaw(Serializer::pointer, std::vector<unsigned char>& signature);
|
||||
bool checkSignRaw(Serializer::pointer, int signaturePosition=-1, int signedData=-1);
|
||||
CKey& peekPrivKey() { return mPrivateKey; }
|
||||
CKey& peekPubKey() { return mPublicKey; }
|
||||
|
||||
const uint160& getAddress(void) const { return mAddress; }
|
||||
uint160 getAddress(void) const { return mAddress.GetHash160(); }
|
||||
};
|
||||
|
||||
class Wallet : public CBasicKeyStore
|
||||
|
||||
Reference in New Issue
Block a user