Skip to content

Commit

Permalink
Merge pull request #797 from UdjinM6/fixDSIXRelay
Browse files Browse the repository at this point in the history
fix RelayTransaction to relay correct message (dstx/ix)
  • Loading branch information
schinzelh committed May 24, 2016
2 parents 717b21d + c845e59 commit 9608647
Showing 1 changed file with 16 additions and 4 deletions.
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

0 comments on commit 9608647

Please sign in to comment.