Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix RelayTransaction to relay correct message (dstx/ix) #797

Merged
merged 1 commit into from
May 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2070,15 +2070,27 @@ void RelayTransaction(const CTransaction& tx)
{
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(10000);
ss << tx;
uint256 hash = tx.GetHash();
if(mapDarksendBroadcastTxes.count(hash)) { // MSG_DSTX
ss <<
mapDarksendBroadcastTxes[hash].tx <<
mapDarksendBroadcastTxes[hash].vin <<
mapDarksendBroadcastTxes[hash].vchSig <<
mapDarksendBroadcastTxes[hash].sigTime;
} else if(mapTxLockReq.count(hash)) { // MSG_TXLOCK_REQUEST
ss << mapTxLockReq[hash];
} else { // MSG_TX
ss << tx;
}
RelayTransaction(tx, ss);
}

void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
{
int nInv = mapDarksendBroadcastTxes.count(tx.GetHash()) ? MSG_DSTX :
(mapTxLockReq.count(tx.GetHash()) ? MSG_TXLOCK_REQUEST : MSG_TX);
CInv inv(nInv, tx.GetHash());
uint256 hash = tx.GetHash();
int nInv = mapDarksendBroadcastTxes.count(hash) ? MSG_DSTX :
(mapTxLockReq.count(hash) ? MSG_TXLOCK_REQUEST : MSG_TX);
CInv inv(nInv, hash);
{
LOCK(cs_mapRelay);
// Expire old relay messages
Expand Down