Change mapRelay to store CTransactions

This commit is contained in:
Pieter Wuille
2016-04-14 16:04:50 +02:00
parent 97d0b9889f
commit 38c310299c
3 changed files with 8 additions and 21 deletions

View File

@@ -4456,7 +4456,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
bool pushed = false;
{
LOCK(cs_mapRelay);
map<CInv, CDataStream>::iterator mi = mapRelay.find(inv);
map<uint256, CTransaction>::iterator mi = mapRelay.find(inv.hash);
if (mi != mapRelay.end()) {
pfrom->PushMessage(inv.GetCommand(), (*mi).second);
pushed = true;
@@ -4465,10 +4465,7 @@ void static ProcessGetData(CNode* pfrom, const Consensus::Params& consensusParam
if (!pushed && inv.type == MSG_TX) {
CTransaction tx;
if (mempool.lookup(inv.hash, tx)) {
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000);
ss << tx;
pfrom->PushMessage(NetMsgType::TX, ss);
pfrom->PushMessage(NetMsgType::TX, tx);
pushed = true;
}
}