|
|
@ -90,8 +90,8 @@ std::string strSubVersion; |
|
|
|
|
|
|
|
|
|
|
|
vector<CNode*> vNodes; |
|
|
|
vector<CNode*> vNodes; |
|
|
|
CCriticalSection cs_vNodes; |
|
|
|
CCriticalSection cs_vNodes; |
|
|
|
map<CInv, CDataStream> mapRelay; |
|
|
|
map<uint256, CTransaction> mapRelay; |
|
|
|
deque<pair<int64_t, CInv> > vRelayExpiration; |
|
|
|
deque<pair<int64_t, uint256> > vRelayExpiration; |
|
|
|
CCriticalSection cs_mapRelay; |
|
|
|
CCriticalSection cs_mapRelay; |
|
|
|
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ); |
|
|
|
limitedmap<uint256, int64_t> mapAlreadyAskedFor(MAX_INV_SZ); |
|
|
|
|
|
|
|
|
|
|
@ -2054,14 +2054,6 @@ instance_of_cnetcleanup; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void RelayTransaction(const CTransaction& tx, CFeeRate feerate) |
|
|
|
void RelayTransaction(const CTransaction& tx, CFeeRate feerate) |
|
|
|
{ |
|
|
|
|
|
|
|
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); |
|
|
|
|
|
|
|
ss.reserve(10000); |
|
|
|
|
|
|
|
ss << tx; |
|
|
|
|
|
|
|
RelayTransaction(tx, feerate, ss); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void RelayTransaction(const CTransaction& tx, CFeeRate feerate, const CDataStream& ss) |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
CInv inv(MSG_TX, tx.GetHash()); |
|
|
|
CInv inv(MSG_TX, tx.GetHash()); |
|
|
|
{ |
|
|
|
{ |
|
|
@ -2073,9 +2065,8 @@ void RelayTransaction(const CTransaction& tx, CFeeRate feerate, const CDataStrea |
|
|
|
vRelayExpiration.pop_front(); |
|
|
|
vRelayExpiration.pop_front(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Save original serialized message so newer versions are preserved
|
|
|
|
mapRelay.insert(std::make_pair(inv.hash, tx)); |
|
|
|
mapRelay.insert(std::make_pair(inv, ss)); |
|
|
|
vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv.hash)); |
|
|
|
vRelayExpiration.push_back(std::make_pair(GetTime() + 15 * 60, inv)); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
LOCK(cs_vNodes); |
|
|
|
LOCK(cs_vNodes); |
|
|
|
BOOST_FOREACH(CNode* pnode, vNodes) |
|
|
|
BOOST_FOREACH(CNode* pnode, vNodes) |
|
|
|