| 2002 | } |
| 2003 | |
| 2004 | UniValue MempoolInfoToJSON(const CTxMemPool& pool) |
| 2005 | { |
| 2006 | // Make sure this call is atomic in the pool. |
| 2007 | LOCK(pool.cs); |
| 2008 | UniValue ret(UniValue::VOBJ); |
| 2009 | ret.pushKV("loaded", pool.IsLoaded()); |
| 2010 | ret.pushKV("size", (int64_t)pool.size()); |
| 2011 | ret.pushKV("bytes", (int64_t)pool.GetTotalTxSize()); |
| 2012 | ret.pushKV("usage", (int64_t)pool.DynamicMemoryUsage()); |
| 2013 | ret.pushKV("total_fee", ValueFromAmount(pool.GetTotalFee())); |
| 2014 | size_t maxmempool = gArgs.GetIntArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; |
| 2015 | ret.pushKV("maxmempool", (int64_t) maxmempool); |
| 2016 | ret.pushKV("mempoolminfee", ValueFromAmount(std::max(pool.GetMinFee(maxmempool), ::minRelayTxFee).GetFeePerK())); |
| 2017 | ret.pushKV("minrelaytxfee", ValueFromAmount(::minRelayTxFee.GetFeePerK())); |
| 2018 | ret.pushKV("unbroadcastcount", uint64_t{pool.GetUnbroadcastTxs().size()}); |
| 2019 | return ret; |
| 2020 | } |
| 2021 | |
| 2022 | static RPCHelpMan getmempoolinfo() |
| 2023 | { |
no test coverage detected