|
|
@ -2135,8 +2135,17 @@ bool static AlreadyHave(CTxDB& txdb, const CInv& inv) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch (inv.type) |
|
|
|
switch (inv.type) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case MSG_TX: return mapTransactions.count(inv.hash) || mapOrphanTransactions.count(inv.hash) || txdb.ContainsTx(inv.hash); |
|
|
|
case MSG_TX: |
|
|
|
case MSG_BLOCK: return mapBlockIndex.count(inv.hash) || mapOrphanBlocks.count(inv.hash); |
|
|
|
{ |
|
|
|
|
|
|
|
LOCK(cs_mapTransactions); |
|
|
|
|
|
|
|
return mapTransactions.count(inv.hash) || |
|
|
|
|
|
|
|
mapOrphanTransactions.count(inv.hash) || |
|
|
|
|
|
|
|
txdb.ContainsTx(inv.hash); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case MSG_BLOCK: |
|
|
|
|
|
|
|
return mapBlockIndex.count(inv.hash) || |
|
|
|
|
|
|
|
mapOrphanBlocks.count(inv.hash); |
|
|
|
} |
|
|
|
} |
|
|
|
// Don't know what it is, just say we already got one
|
|
|
|
// Don't know what it is, just say we already got one
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|