search inputs separately for IX

This commit is contained in:
Evan Duffield 2015-02-01 09:16:31 -07:00
parent 8164721b25
commit d3763f6f82

View File

@ -49,10 +49,13 @@ void ProcessMessageInstantX(CNode* pfrom, std::string& strCommand, CDataStream&
return;
}
int nTxAge = GetInputAge(tx.vin[0]);
if(nTxAge <= 0){
LogPrintf("ProcessMessageInstantX::txlreq - Transaction not found / too new: %d / %s\n", nTxAge, tx.GetHash().ToString().c_str());
return;
int nTxAge = 0;
BOOST_REVERSE_FOREACH(CTxIn i, tx.vin){
nTxAge = GetInputAge(i);
if(nTxAge <= 5){
LogPrintf("ProcessMessageInstantX::txlreq - Transaction not found / too new: %d / %s\n", nTxAge, tx.GetHash().ToString().c_str());
return;
}
}
int nBlockHeight = chainActive.Tip()->nHeight - nTxAge; //calculate the height