Skip to content

Commit 9315e69

Browse files
committed
move-only: keep functions used in wallet-enabled segments within macro
Required to avoid `-Wunused-function` warnings when building with wallet support disabled.
1 parent 6729d69 commit 9315e69

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/rpc/evo.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,19 @@ static RPCArg GetRpcArg(const std::string& strParamName)
180180
return it->second;
181181
}
182182

183+
static CBLSSecretKey ParseBLSSecretKey(const std::string& hexKey, const std::string& paramName)
184+
{
185+
CBLSSecretKey secKey;
186+
187+
// Actually, bool flag for bls::PrivateKey has other meaning (modOrder)
188+
if (!secKey.SetHexStr(hexKey, false)) {
189+
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be a valid BLS secret key", paramName));
190+
}
191+
return secKey;
192+
}
193+
194+
#ifdef ENABLE_WALLET
195+
183196
static CKeyID ParsePubKeyIDFromAddress(const std::string& strAddress, const std::string& paramName)
184197
{
185198
CTxDestination dest = DecodeDestination(strAddress);
@@ -199,24 +212,11 @@ static CBLSPublicKey ParseBLSPubKey(const std::string& hexKey, const std::string
199212
return pubKey;
200213
}
201214

202-
static CBLSSecretKey ParseBLSSecretKey(const std::string& hexKey, const std::string& paramName)
203-
{
204-
CBLSSecretKey secKey;
205-
206-
// Actually, bool flag for bls::PrivateKey has other meaning (modOrder)
207-
if (!secKey.SetHexStr(hexKey, false)) {
208-
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("%s must be a valid BLS secret key", paramName));
209-
}
210-
return secKey;
211-
}
212-
213215
static bool ValidatePlatformPort(const int32_t port)
214216
{
215217
return port >= 1 && port <= std::numeric_limits<uint16_t>::max();
216218
}
217219

218-
#ifdef ENABLE_WALLET
219-
220220
template <typename SpecialTxPayload>
221221
static void FundSpecialTx(CWallet& wallet, CMutableTransaction& tx, const SpecialTxPayload& payload,
222222
const CTxDestination& fundDest) EXCLUSIVE_LOCKS_REQUIRED(!wallet.cs_wallet)

0 commit comments

Comments
 (0)