Complete the fetch by hash logic, including tracking the hashes we want.

This commit is contained in:
JoelKatz
2013-01-04 22:14:53 -08:00
parent cb6f73cc89
commit dfbd640f6c
6 changed files with 71 additions and 7 deletions

View File

@@ -100,6 +100,18 @@ bool NetworkOPs::haveLedgerRange(uint32 from, uint32 to)
return mLedgerMaster->haveLedgerRange(from, to);
}
bool NetworkOPs::addWantedHash(const uint256& h)
{
boost::recursive_mutex::scoped_lock sl(mWantedHashLock);
return mWantedHashes.insert(h).second;
}
bool NetworkOPs::isWantedHash(const uint256& h, bool remove)
{
boost::recursive_mutex::scoped_lock sl(mWantedHashLock);
return (remove ? mWantedHashes.erase(h) : mWantedHashes.count(h)) != 0;
}
void NetworkOPs::submitTransaction(Job&, SerializedTransaction::pointer iTrans, stCallback callback)
{ // this is an asynchronous interface
Serializer s;