Skip to content

Commit fa0f666

Browse files
author
MarcoFalke
committed
style: Add static keyword where possible in rpc/mempool
1 parent 98e9d8e commit fa0f666

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/rpc/mempool.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
#include <univalue.h>
1717
#include <validation.h>
1818

19-
static std::vector<RPCResult> MempoolEntryDescription() { return {
19+
static std::vector<RPCResult> MempoolEntryDescription()
20+
{
21+
return {
2022
RPCResult{RPCResult::Type::NUM, "vsize", "virtual transaction size as defined in BIP 141. This is different from actual serialized size for witness transactions as witness data is discounted."},
2123
RPCResult{RPCResult::Type::NUM, "weight", "transaction weight as defined in BIP 141."},
2224
RPCResult{RPCResult::Type::STR_AMOUNT, "fee", /*optional=*/true,
@@ -50,7 +52,8 @@ static std::vector<RPCResult> MempoolEntryDescription() { return {
5052
{RPCResult{RPCResult::Type::STR_HEX, "transactionid", "child transaction id"}}},
5153
RPCResult{RPCResult::Type::BOOL, "bip125-replaceable", "Whether this transaction could be replaced due to BIP125 (replace-by-fee)"},
5254
RPCResult{RPCResult::Type::BOOL, "unbroadcast", "Whether this transaction is currently unbroadcast (initial broadcast not yet acknowledged by any peers)"},
53-
};}
55+
};
56+
}
5457

5558
static void entryToJSON(const CTxMemPool& pool, UniValue& info, const CTxMemPoolEntry& e) EXCLUSIVE_LOCKS_REQUIRED(pool.cs)
5659
{
@@ -164,7 +167,7 @@ UniValue MempoolToJSON(const CTxMemPool& pool, bool verbose, bool include_mempoo
164167
}
165168
}
166169

167-
RPCHelpMan getrawmempool()
170+
static RPCHelpMan getrawmempool()
168171
{
169172
return RPCHelpMan{"getrawmempool",
170173
"\nReturns all transaction ids in memory pool as a json array of string transaction ids.\n"
@@ -214,7 +217,7 @@ RPCHelpMan getrawmempool()
214217
};
215218
}
216219

217-
RPCHelpMan getmempoolancestors()
220+
static RPCHelpMan getmempoolancestors()
218221
{
219222
return RPCHelpMan{"getmempoolancestors",
220223
"\nIf txid is in the mempool, returns all in-mempool ancestors.\n",
@@ -278,7 +281,7 @@ RPCHelpMan getmempoolancestors()
278281
};
279282
}
280283

281-
RPCHelpMan getmempooldescendants()
284+
static RPCHelpMan getmempooldescendants()
282285
{
283286
return RPCHelpMan{"getmempooldescendants",
284287
"\nIf txid is in the mempool, returns all in-mempool descendants.\n",
@@ -343,7 +346,7 @@ RPCHelpMan getmempooldescendants()
343346
};
344347
}
345348

346-
RPCHelpMan getmempoolentry()
349+
static RPCHelpMan getmempoolentry()
347350
{
348351
return RPCHelpMan{"getmempoolentry",
349352
"\nReturns mempool data for given transaction\n",
@@ -394,7 +397,7 @@ UniValue MempoolInfoToJSON(const CTxMemPool& pool)
394397
return ret;
395398
}
396399

397-
RPCHelpMan getmempoolinfo()
400+
static RPCHelpMan getmempoolinfo()
398401
{
399402
return RPCHelpMan{"getmempoolinfo",
400403
"\nReturns details on the active state of the TX memory pool.\n",
@@ -423,7 +426,7 @@ RPCHelpMan getmempoolinfo()
423426
};
424427
}
425428

426-
RPCHelpMan savemempool()
429+
static RPCHelpMan savemempool()
427430
{
428431
return RPCHelpMan{"savemempool",
429432
"\nDumps the mempool to disk. It will fail until the previous dump is fully loaded.\n",

0 commit comments

Comments
 (0)