Skip to content

Commit

Permalink
Merge pull request bitcoin#798 from UdjinM6/fixDSSignFinal
Browse files Browse the repository at this point in the history
Fix final dstx signing
  • Loading branch information
schinzelh committed May 24, 2016
2 parents 9608647 + 519577d commit 773744e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,19 +320,25 @@ void CDarksendPool::ProcessMessageDarksend(CNode* pfrom, std::string& strCommand
vector<CTxIn> sigs;
vRecv >> sigs;

bool success = false;
int count = 0;
bool success = true;
int nSigIndex = 0;
int nSigsCount = (int)sigs.size();

BOOST_FOREACH(const CTxIn item, sigs)
{
if(AddScriptSig(item)) success = true;
LogPrint("darksend", " -- sigs count %d %d\n", (int)sigs.size(), count);
count++;
nSigIndex++;
if(!AddScriptSig(item)) {
success = false;
break;
}
LogPrint("darksend", "DSSIGNFINALTX - AddScriptSig %d/%d - success\n", nSigIndex, nSigsCount);
}

if(success){
darkSendPool.Check();
RelayStatus(darkSendPool.sessionID, darkSendPool.GetState(), darkSendPool.GetEntriesCount(), MASTERNODE_RESET);
Check();
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
if (pfrom->nVersion < MIN_POOL_PEER_PROTO_VERSION) {
Expand Down

0 comments on commit 773744e

Please sign in to comment.