Cleanup, comment out test code, prepare for release PR

This commit is contained in:
miketout
2018-10-13 22:49:45 -07:00
parent 11f4f605e2
commit ec8a120b4d
8 changed files with 43 additions and 38 deletions

View File

@@ -1420,12 +1420,11 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
else
return 0;
// TODO: REMOVE THIS: THIS MAKES A CHEAT TRANSACTION FOR EVERY STAKE FOR TESTING
CMutableTransaction cheat;
// UP TO HERE
// !! DISABLE THIS FOR RELEASE: THIS MAKES A CHEAT TRANSACTION FOR EVERY STAKE FOR TESTING
//CMutableTransaction cheat;
// !! DOWN TO HERE
// if we are staking with the extended format, add the opreturn data required
//
if (extendedStake)
{
uint256 srcBlock = uint256();
@@ -1440,30 +1439,30 @@ int32_t CWallet::VerusStakeTransaction(CBlock *pBlock, CMutableTransaction &txNe
if ((pSrcIndex = mapBlockIndex[srcBlock]) == 0)
return 0;
// TODO: REMOVE THIS: THIS MAKES A CHEAT TRANSACTION FOR EVERY STAKE FOR TESTING
cheat = CMutableTransaction(txNew);
cheat.vout[1].scriptPubKey << OP_RETURN
<< CStakeParams(pSrcIndex->GetHeight(), tipindex->GetHeight() + 1, pSrcIndex->GetBlockHash(), pk).AsVector();
// REMOVE UP TO HERE
// !! DISABLE THIS FOR RELEASE: THIS MAKES A CHEAT TRANSACTION FOR EVERY STAKE FOR TESTING
//cheat = CMutableTransaction(txNew);
//cheat.vout[1].scriptPubKey << OP_RETURN
// << CStakeParams(pSrcIndex->GetHeight(), tipindex->GetHeight() + 1, pSrcIndex->GetBlockHash(), pk).AsVector();
// !! DOWN TO HERE
txOut1.scriptPubKey << OP_RETURN
<< CStakeParams(pSrcIndex->GetHeight(), tipindex->GetHeight() + 1, tipindex->GetBlockHash(), pk).AsVector();
}
// TODO REMOVE THIS TOO
nValue = cheat.vout[0].nValue = stakeSource.vout[voutNum].nValue - txfee;
cheat.nLockTime = 0;
CTransaction cheatConst(cheat);
SignatureData cheatSig;
if (!ProduceSignature(TransactionSignatureCreator(&keystore, &cheatConst, 0, nValue, SIGHASH_ALL), stakeSource.vout[voutNum].scriptPubKey, cheatSig, consensusBranchId))
fprintf(stderr,"failed to create cheat test signature\n");
else
{
uint8_t *ptr;
UpdateTransaction(cheat,0,cheatSig);
cheatList.Add(CTxHolder(CTransaction(cheat), tipindex->GetHeight() + 1));
}
// UP TO HERE
// !! DISABLE THIS FOR RELEASE: REMOVE THIS TOO
//nValue = cheat.vout[0].nValue = stakeSource.vout[voutNum].nValue - txfee;
//cheat.nLockTime = 0;
//CTransaction cheatConst(cheat);
//SignatureData cheatSig;
//if (!ProduceSignature(TransactionSignatureCreator(&keystore, &cheatConst, 0, nValue, SIGHASH_ALL), stakeSource.vout[voutNum].scriptPubKey, cheatSig, consensusBranchId))
// fprintf(stderr,"failed to create cheat test signature\n");
//else
//{
// uint8_t *ptr;
// UpdateTransaction(cheat,0,cheatSig);
// cheatList.Add(CTxHolder(CTransaction(cheat), tipindex->GetHeight() + 1));
//}
// !! DOWN TO HERE
nValue = txNew.vout[0].nValue = stakeSource.vout[voutNum].nValue - txfee;