Conversation
| if (fJustCheck) | ||
| return true; | ||
|
|
||
| //TODO: LOG ERRORS OR TERMINATE METHOD AND RETURN ERROR? |
There was a problem hiding this comment.
We probably also want this code only to be activated if the height is above the voting height.
src/main.cpp
Outdated
| vector <CTransaction> vOrderedProposalTransactions; | ||
| proposalManager.GetDeterministicOrdering(pindexPrev->hashProofOfStake, vProposalTransactions, | ||
| vOrderedProposalTransactions); | ||
| for (CTransaction txProposal: vOrderedProposalTransactions) { |
There was a problem hiding this comment.
any reason this shouldn't be const ref?
src/main.cpp
Outdated
| } | ||
|
|
||
| vector <CTransaction> vOrderedProposalTransactions; | ||
| proposalManager.GetDeterministicOrdering(pindexPrev->hashProofOfStake, vProposalTransactions, |
There was a problem hiding this comment.
Since this method returns a bool, lets handle the case that it returns false.
src/main.cpp
Outdated
| // If the maximum fee provided by the proposal creator is less than the required fee | ||
| // then create an unaccepted proposal refund | ||
| if (nRequiredFee > proposal.GetMaxFee()) { | ||
| proposalManager.AddRefundToCoinBase(proposal, nRequiredFee, nTxFee, false, txCoinBase); |
There was a problem hiding this comment.
Lets handle the case that this method returns false.
Also we could simplify the scoping doing something like:
bool fProposalAccepted = nRequiredFee > proposal.GetMaxFee();
proposalManager.AddRefundToCoinBase(proposal, nRequiredFee, nTxFee, fProposalAccepted, txCoinBase);
| CScript scriptProposal = tx.vout[0].scriptPubKey; | ||
| vchProposal.insert(vchProposal.end(), scriptProposal.begin() + 6, scriptProposal.end()); | ||
|
|
||
| vchProposal.insert(vchProposal.end(), scriptProposal.begin() + (scriptProposal.size() > 0x04c ? 7 : 6), scriptProposal.end()); |
There was a problem hiding this comment.
Replace the magic numbers with typedefs or #define macro.
| bool CVoteProposalManager::GetAcceptedTxProposals(const CTransaction& txCoinBase, const std::vector<CTransaction>& vOrderedTxProposals, | ||
| std::vector<CTransaction>& vAcceptedTxProposals) | ||
| { | ||
| if (!txCoinBase.IsCoinBase()) { |
There was a problem hiding this comment.
We will need to add more logic to IsCoinBase() so that these transactions are still seen as coinbase.
There was a problem hiding this comment.
What additional logic is needed?
IsCoinBase() just checks -> (vin.size() == 1 && vin[0].prevout.IsNull() && vout.size() >= 1);
By this logic I think refund transactions will still be seen as coinbase transactions.
…tic ordering algo complete
… rules to connectblock
The code is passing the basic tests I created so I think it's ready for review. I tried cleaning up a little but there's still some refactoring I plan on doing. Also, I'm not positive that all the necessary height checks for the hard fork were put in. Besides that, all that's left to do is tweak the fee heuristic.