Merge pull request #798 from UdjinM6/fixDSSignFinal

Fix final dstx signing
This commit is contained in:
Holger Schinzel 2016-05-24 07:20:45 +02:00
commit 773744ed16

View File

@ -320,19 +320,25 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
vector<CTxIn> sigs; vector<CTxIn> sigs;
vRecv >> sigs; vRecv >> sigs;
bool success = false; bool success = true;
int count = 0; int nSigIndex = 0;
int nSigsCount = (int)sigs.size();
BOOST_FOREACH(const CTxIn item, sigs) BOOST_FOREACH(const CTxIn item, sigs)
{ {
if(AddScriptSig(item)) success = true; nSigIndex++;
LogPrint("darksend", " -- sigs count %d %d\n", (int)sigs.size(), count); if(!AddScriptSig(item)) {
count++; success = false;
break;
}
LogPrint("darksend", "DSSIGNFINALTX - AddScriptSig %d/%d - success\n", nSigIndex, nSigsCount);
} }
if(success){ if(success){
darkSendPool.Check(); Check();
RelayStatus(darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_RESET); RelayStatus(sessionID, GetState(), GetEntriesCount(), MASTERNODE_RESET);
} else {
LogPrint("darksend", "DSSIGNFINALTX - AddScriptSig failed at %d/%d, session %d\n", nSigIndex, nSigsCount, sessionID);
} }
} else if (strCommand == NetMsgType::DSFINALTX) { //Darksend Final tx } else if (strCommand == NetMsgType::DSFINALTX) { //Darksend Final tx
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) { if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {