Skip to content

Commit

Permalink
Remove old MESS_VER_STRMESS message version try-catch.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Jul 3, 2021
1 parent 35fca11 commit dc0fc95
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 34 deletions.
7 changes: 1 addition & 6 deletions src/budget/budgetvote.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ class CBudgetVote : public CSignedMessage
nVote = (VoteDirection) nVoteInt;
READWRITE(nTime);
READWRITE(vchSig);
try
{
READWRITE(nMessVersion);
} catch (...) {
nMessVersion = MessageVersion::MESS_VER_STRMESS;
}
READWRITE(nMessVersion);
}
};

Expand Down
7 changes: 1 addition & 6 deletions src/budget/finalizedbudgetvote.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,7 @@ class CFinalizedBudgetVote : public CSignedMessage
READWRITE(nBudgetHash);
READWRITE(nTime);
READWRITE(vchSig);
try
{
READWRITE(nMessVersion);
} catch (...) {
nMessVersion = MessageVersion::MESS_VER_STRMESS;
}
READWRITE(nMessVersion);
}
};

Expand Down
7 changes: 1 addition & 6 deletions src/masternode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,7 @@ class CMasternodePaymentWinner : public CSignedMessage
READWRITE(nBlockHeight);
READWRITE(payee);
READWRITE(vchSig);
try
{
READWRITE(nMessVersion);
} catch (...) {
nMessVersion = MessageVersion::MESS_VER_STRMESS;
}
READWRITE(nMessVersion);
}

std::string ToString()
Expand Down
7 changes: 1 addition & 6 deletions src/masternode.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,7 @@ class CMasternodePing : public CSignedMessage
READWRITE(blockHash);
READWRITE(sigTime);
READWRITE(vchSig);
try
{
READWRITE(nMessVersion);
} catch (...) {
nMessVersion = MessageVersion::MESS_VER_STRMESS;
}
READWRITE(nMessVersion);
}

uint256 GetHash() const;
Expand Down
2 changes: 1 addition & 1 deletion src/messagesigner.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
extern const std::string strMessageMagic;

enum MessageVersion {
MESS_VER_STRMESS = 0,
MESS_VER_STRMESS = 0, // old format
MESS_VER_HASH = 1,
};

Expand Down
4 changes: 1 addition & 3 deletions src/rpc/budget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,7 @@ UniValue mnbudgetrawvote(const JSONRPCRequest& request)
vote.SetVchSig(vchSig);

if (!vote.CheckSignature(pmn->pubKeyMasternode.GetID())) {
// try old message version
vote.nMessVersion = MessageVersion::MESS_VER_STRMESS;
if (!vote.CheckSignature(pmn->pubKeyMasternode.GetID())) return "Failure to verify signature.";
return "Failure to verify signature.";
}

std::string strError;
Expand Down
7 changes: 1 addition & 6 deletions src/spork.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ class CSporkMessage : public CSignedMessage
READWRITE(nValue);
READWRITE(nTimeSigned);
READWRITE(vchSig);
try
{
READWRITE(nMessVersion);
} catch (...) {
nMessVersion = MessageVersion::MESS_VER_STRMESS;
}
READWRITE(nMessVersion);
}
};

Expand Down

0 comments on commit dc0fc95

Please sign in to comment.