Skip to content

Commit a102664

Browse files
committed
RPC, mnbudgetrawvote: use ProcessProposalVote instead of AddAndRelayProposalVote.
And remove the now unused AddAndRelayProposalVote.
1 parent 42bca64 commit a102664

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/budget/budgetmanager.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -901,16 +901,6 @@ CDataStream CBudgetManager::GetFinalizedBudgetSerialized(const uint256& budgetHa
901901
return mapFinalizedBudgets.at(budgetHash).GetBroadcast();
902902
}
903903

904-
bool CBudgetManager::AddAndRelayProposalVote(const CBudgetVote& vote, std::string& strError)
905-
{
906-
if (UpdateProposal(vote, nullptr, strError)) {
907-
AddSeenProposalVote(vote);
908-
vote.Relay();
909-
return true;
910-
}
911-
return false;
912-
}
913-
914904
void CBudgetManager::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload)
915905
{
916906
NewBlock();

src/budget/budgetmanager.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ class CBudgetManager : public CValidationInterface
9393
CDataStream GetFinalizedBudgetVoteSerialized(const uint256& voteHash) const;
9494
CDataStream GetFinalizedBudgetSerialized(const uint256& budgetHash) const;
9595

96-
bool AddAndRelayProposalVote(const CBudgetVote& vote, std::string& strError);
97-
9896
// sets strProposal of a CFinalizedBudget reference
9997
void SetBudgetProposalsStr(CFinalizedBudget& finalizedBudget) const;
10098

src/rpc/budget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,11 @@ UniValue mnbudgetrawvote(const JSONRPCRequest& request)
527527
return "Failure to verify signature.";
528528
}
529529

530-
std::string strError;
531-
if (g_budgetman.AddAndRelayProposalVote(vote, strError)) {
530+
CValidationState state;
531+
if (g_budgetman.ProcessProposalVote(vote, nullptr, state)) {
532532
return "Voted successfully";
533533
} else {
534-
return "Error voting : " + strError;
534+
return "Error voting : " + state.GetRejectReason() + ". " + state.GetDebugMessage();
535535
}
536536
}
537537

0 commit comments

Comments
 (0)