mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Fire up the initial ledgers and attach them to the application.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "PeerDoor.h"
|
||||
#include "RPCDoor.h"
|
||||
#include "BitcoinUtil.h"
|
||||
#include "DeterministicKeys.h"
|
||||
#include "database/SqliteDatabase.h"
|
||||
//#include <boost/log/trivial.hpp>
|
||||
#include <iostream>
|
||||
@@ -29,6 +30,17 @@ Application::Application()
|
||||
mWallet.load();
|
||||
mPeerDoor=NULL;
|
||||
mRPCDoor=NULL;
|
||||
|
||||
DetKeySet ks("This is a test payphrase.");
|
||||
|
||||
Ledger::pointer firstLedger(new Ledger(ks.getAccountID(0), 1000000));
|
||||
firstLedger->setClosed();
|
||||
firstLedger->setAccepted();
|
||||
mMasterLedger.pushLedger(firstLedger);
|
||||
|
||||
Ledger::pointer secondLedger=firstLedger->closeLedger(time(NULL));
|
||||
mMasterLedger.pushLedger(secondLedger);
|
||||
mMasterLedger.setSynced();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,4 +68,4 @@ public:
|
||||
|
||||
extern Application* theApp;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -133,6 +133,11 @@ CKey::pointer DetKeySet::getPrivKey(uint32 n)
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint160 DetKeySet::getAccountID(uint32 n)
|
||||
{
|
||||
return getPubKey(n)->GetAddress().GetHash160();
|
||||
}
|
||||
|
||||
void DetKeySet::getPubKeys(uint32 first, uint32 count, std::list<CKey::pointer>& keys)
|
||||
{
|
||||
while(count-->0)
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
|
||||
CKey::pointer getPubKey(uint32 n);
|
||||
CKey::pointer getPrivKey(uint32 n);
|
||||
uint160 getAccountID(uint32 n);
|
||||
|
||||
void getPubKeys(uint32 first, uint32 count, std::list<CKey::pointer>& keys);
|
||||
void getPrivKeys(uint32 first, uint32 count, std::list<CKey::pointer>& keys);
|
||||
|
||||
@@ -33,8 +33,8 @@ public:
|
||||
LedgerMaster();
|
||||
|
||||
uint32 getCurrentLedgerIndex();
|
||||
bool IsSynced() { return mIsSynced; }
|
||||
void SetSynced() { mIsSynced=true; }
|
||||
bool isSynced() { return mIsSynced; }
|
||||
void setSynced() { mIsSynced=true; }
|
||||
|
||||
Ledger::pointer getCurrentLedger() { return mCurrentLedger; }
|
||||
Ledger::pointer getClosingLedger() { return mFinalizingLedger; }
|
||||
|
||||
5
Makefile
5
Makefile
@@ -71,7 +71,8 @@ SRCS= keystore.cpp BitcoinUtil.cpp \
|
||||
AccountState.cpp Wallet.cpp NewcoinAddress.cpp Config.cpp PackedMessage.cpp \
|
||||
Application.cpp TimingService.cpp KnownNodeList.cpp ConnectionPool.cpp Peer.cpp \
|
||||
PeerDoor.cpp RPCDoor.cpp RPCServer.cpp rpc.cpp Conversion.cpp RequestParser.cpp HashedObject.cpp \
|
||||
UniqueNodeList.cpp PubKeyCache.cpp SHAMapDiff.cpp DeterministicKeys.cpp
|
||||
UniqueNodeList.cpp PubKeyCache.cpp SHAMapDiff.cpp DeterministicKeys.cpp LedgerMaster.cpp \
|
||||
LedgerHistory.cpp
|
||||
|
||||
DBSRCS= SqliteDatabase.cpp database.cpp
|
||||
|
||||
@@ -94,7 +95,7 @@ all: newcoind
|
||||
newcoin.pb.h: newcoin.proto
|
||||
protoc --cpp_out=. newcoin.proto
|
||||
|
||||
%.o: %.cpp newcoin.pb.h $(HEADERS)
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(CXXFLAGS) -o $@ $<
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user