| 514 | |
| 515 | |
| 516 | bool CTransactionLock::SignaturesValid() { |
| 517 | |
| 518 | for (CConsensusVote vote : vecConsensusVotes) { |
| 519 | int n = GetMasternodeRank(vote.vinMasternode, vote.nBlockHeight, MIN_PROTO_VERSION); |
| 520 | |
| 521 | if (n == -1) { |
| 522 | LogPrintf("InstantX::DoConsensusVote - Unknown Masternode\n"); |
| 523 | return false; |
| 524 | } |
| 525 | |
| 526 | if (n > INSTANTX_SIGNATURES_TOTAL) { |
| 527 | LogPrintf("InstantX::DoConsensusVote - Masternode not in the top %s\n", INSTANTX_SIGNATURES_TOTAL); |
| 528 | return false; |
| 529 | } |
| 530 | |
| 531 | if (!vote.SignatureValid()) { |
| 532 | LogPrintf("InstantX::CTransactionLock::SignaturesValid - Signature not valid\n"); |
| 533 | return false; |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | return true; |
| 538 | } |
| 539 | |
| 540 | void CTransactionLock::AddSignature(CConsensusVote& cv) { |
| 541 | vecConsensusVotes.push_back(cv); |
nothing calls this directly
no test coverage detected