Support "standalone" mode (-a or --standalone) in which we do not connect

to the network and do not close ledgers. This mode makes it much easier to
test transactions as they are only applied once to the open ledger.
This commit is contained in:
JoelKatz
2012-08-14 15:35:30 -07:00
parent 4b2ae556bd
commit e473ce8424
8 changed files with 39 additions and 6 deletions

View File

@@ -42,6 +42,9 @@ ConnectionPool::ConnectionPool(boost::asio::io_service& io_service) :
void ConnectionPool::start()
{
if (theConfig.RUN_STANDALONE)
return;
// Start running policy.
policyEnforce();
@@ -243,6 +246,8 @@ void ConnectionPool::relayMessage(Peer* fromPeer, PackedMessage::pointer msg)
// Requires sane IP and port.
void ConnectionPool::connectTo(const std::string& strIp, int iPort)
{
if (theConfig.RUN_STANDALONE)
return;
{
Database* db = theApp->getWalletDB()->getDB();
ScopedLock sl(theApp->getWalletDB()->getDBLock());