#include "netbase.h"
#include "protocol.h"
#include "addrman.h"
+#include "hash.h"
class CRequestTracker;
class CNode;
THREAD_SOCKETHANDLER,
THREAD_OPENCONNECTIONS,
THREAD_MESSAGEHANDLER,
- THREAD_MINER,
THREAD_RPCLISTENER,
THREAD_UPNP,
THREAD_DNSSEED,
THREAD_DUMPADDRESS,
THREAD_RPCHANDLER,
THREAD_MINTER,
+ THREAD_SCRIPTCHECK,
THREAD_MAX
};
setInventoryKnown.max_size(SendBufferSize() / 1000);
// Be shy and don't send version until we hear
- if (!fInbound)
+ if (hSocket != INVALID_SOCKET && !fInbound)
PushVersion();
}
void copyStats(CNodeStats &stats);
};
-
-
-
-
-
-
-
-
-
inline void RelayInventory(const CInv& inv)
{
// Put on lists to offer to the other nodes
}
}
-template<typename T>
-void RelayMessage(const CInv& inv, const T& a)
-{
- CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
- ss.reserve(10000);
- ss << a;
- RelayMessage(inv, ss);
-}
-
-template<>
-inline void RelayMessage<>(const CInv& inv, const CDataStream& ss)
-{
- {
- LOCK(cs_mapRelay);
- // Expire old relay messages
- while (!vRelayExpiration.empty() && vRelayExpiration.front().first < GetTime())
- {
- mapRelay.erase(vRelayExpiration.front().second);
- vRelayExpiration.pop_front();
- }
-
- // Save original serialized message so newer versions are preserved
- mapRelay.insert(std::make_pair(inv, ss));
- vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv));
- }
-
- RelayInventory(inv);
-}
+class CTransaction;
+void RelayTransaction(const CTransaction& tx, const uint256& hash);
+void RelayTransaction(const CTransaction& tx, const uint256& hash, const CDataStream& ss);
#endif