Skip to content

Commit 14d8ce0

Browse files
committed
Don't use GetMasternodeInfo in CTxLockVote::IsValid
1 parent 1ff2418 commit 14d8ce0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/instantx.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -1038,15 +1038,16 @@ bool CTxLockVote::IsValid(CNode* pnode, CConnman& connman) const
10381038
}
10391039

10401040
// Verify that masternodeProTxHash belongs to the same MN referred by the collateral
1041-
// Only v13 nodes will send us locks with this field set, and only after spork15 activation
1041+
// This is a leftover from the legacy non-deterministic MN list where we used the collateral to identify MNs
1042+
// TODO eventually remove the collateral from CTxLockVote
10421043
if (!masternodeProTxHash.IsNull()) {
1043-
masternode_info_t mnInfo;
1044-
if (!mnodeman.GetMasternodeInfo(masternodeProTxHash, mnInfo) || mnInfo.outpoint != outpointMasternode) {
1044+
auto dmn = mnList.GetValidMN(masternodeProTxHash);
1045+
if (!dmn || dmn->collateralOutpoint != outpointMasternode) {
10451046
LogPrint("instantsend", "CTxLockVote::IsValid -- invalid masternodeProTxHash %s\n", masternodeProTxHash.ToString());
10461047
return false;
10471048
}
1048-
} else if (deterministicMNManager->IsDIP3Active()) {
1049-
LogPrint("instantsend", "CTxLockVote::IsValid -- missing masternodeProTxHash while DIP3 is active\n");
1049+
} else {
1050+
LogPrint("instantsend", "CTxLockVote::IsValid -- missing masternodeProTxHash\n");
10501051
return false;
10511052
}
10521053

0 commit comments

Comments
 (0)