NetworkOPs layer

Begin coding the 'NetworkOPs' layer. This will provide most of the
functions 'client' code will want to call such as functions to lookup
transactions, check on their status, get balances, and so on. Much of the
RPC layer will be a thin wrapper over these functions.

The purpose of this layer is to permit the node to support these functions
regardless of its operating mode or available data, as long as it's
connected to the network. If synchronized and tracking the current ledger,
it can do most functions locally. If not, it can ask for help from other
nodes. If hopeless, it can return an error code.
This commit is contained in:
JoelKatz
2011-12-15 01:19:50 -08:00
parent 0b25b9641f
commit 639ba9dfcb
6 changed files with 164 additions and 9 deletions

View File

@@ -24,9 +24,11 @@ uint64 LedgerMaster::getBalance(std::string& addr)
return mCurrentLedger->getBalance(humanTo160(addr));
}
bool LedgerMaster::addTransaction(Transaction::pointer transaction)
bool LedgerMaster::addHeldTransaction(Transaction::pointer transaction)
{
return mCurrentLedger->applyTransaction(transaction)==Ledger::TR_SUCCESS;
boost::recursive_mutex::scoped_lock ml(mLock);
if(!mHeldTransactionsByID[transaction->getID()])
mHeldTransactionsByID[transaction->getID()]=transaction;
}
void LedgerMaster::pushLedger(Ledger::pointer newLedger)