Skip to content

Commit cf4e9e6

Browse files
fix: move CGovernanceVote inline methods to header for wallet linkage
The methods GetSignatureString() and GetSignatureHash() were only available in libbitcoin_node.a but were being called from wallet.cpp. This caused undefined reference errors when linking dash-wallet since it doesn't link against libbitcoin_node. Moving these simple methods to the header as inline functions resolves the linking issue without requiring wallet binaries to link against the entire node library.
1 parent 6f0723a commit cf4e9e6

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/governance/vote.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,6 @@ uint256 CGovernanceVote::GetHash() const
140140
return hash;
141141
}
142142

143-
uint256 CGovernanceVote::GetSignatureHash() const
144-
{
145-
return SerializeHash(*this);
146-
}
147143

148144
bool CGovernanceVote::CheckSignature(const CKeyID& keyID) const
149145
{
@@ -218,13 +214,6 @@ bool CGovernanceVote::IsValid(const CDeterministicMNList& tip_mn_list, bool useV
218214
}
219215
}
220216

221-
std::string CGovernanceVote::GetSignatureString() const
222-
{
223-
return masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" +
224-
::ToString(nVoteSignal) + "|" +
225-
::ToString(nVoteOutcome) + "|" +
226-
::ToString(nTime);
227-
}
228217

229218
bool operator==(const CGovernanceVote& vote1, const CGovernanceVote& vote2)
230219
{

src/governance/vote.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
#ifndef BITCOIN_GOVERNANCE_VOTE_H
66
#define BITCOIN_GOVERNANCE_VOTE_H
77

8+
#include <hash.h>
89
#include <primitives/transaction.h>
910
#include <uint256.h>
11+
#include <util/string.h>
1012

1113
class CActiveMasternodeManager;
1214
class CBLSPublicKey;
@@ -100,7 +102,13 @@ class CGovernanceVote
100102
bool Sign(const CActiveMasternodeManager& mn_activeman);
101103
bool CheckSignature(const CBLSPublicKey& pubKey) const;
102104
bool IsValid(const CDeterministicMNList& tip_mn_list, bool useVotingKey) const;
103-
std::string GetSignatureString() const;
105+
std::string GetSignatureString() const
106+
{
107+
return masternodeOutpoint.ToStringShort() + "|" + nParentHash.ToString() + "|" +
108+
::ToString(nVoteSignal) + "|" +
109+
::ToString(nVoteOutcome) + "|" +
110+
::ToString(nTime);
111+
}
104112
void Relay(PeerManager& peerman, const CMasternodeSync& mn_sync, const CDeterministicMNList& tip_mn_list) const;
105113

106114
const COutPoint& GetMasternodeOutpoint() const { return masternodeOutpoint; }
@@ -112,7 +120,10 @@ class CGovernanceVote
112120
*/
113121

114122
uint256 GetHash() const;
115-
uint256 GetSignatureHash() const;
123+
uint256 GetSignatureHash() const
124+
{
125+
return SerializeHash(*this);
126+
}
116127

117128
std::string ToString(const CDeterministicMNList& tip_mn_list) const;
118129

0 commit comments

Comments
 (0)