From b57bfe0b1eb8e67113d148381f61ec2f767b8415 Mon Sep 17 00:00:00 2001 From: Francis Reynders Date: Tue, 16 Dec 2014 18:45:43 +0100 Subject: [PATCH] Fixed lookup for correct vin in GetMasterNodeVin when txHash is available. --- src/activemasternode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/activemasternode.cpp b/src/activemasternode.cpp index 769d1c006a4e6..614fea825af40 100644 --- a/src/activemasternode.cpp +++ b/src/activemasternode.cpp @@ -296,10 +296,12 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr if(!strTxHash.empty()) { // Let's find it uint256 txHash(strTxHash); - int outputIndex = boost::lexical_cast(outputIndex); + int outputIndex = 0; + outputIndex = boost::lexical_cast(outputIndex); bool found = false; BOOST_FOREACH(COutput& out, possibleCoins) { - if(true) { + if(out.tx->GetHash() == txHash && out.i == outputIndex) + { selectedOutput = &out; found = true; break;