Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251UniValue failbucket(UniValue::VOBJ);252failbucket.pushKV("startrange", round(buckets.fail.start));253failbucket.pushKV("endrange", round(buckets.fail.end));254failbucket.pushKV("withintarget", round(buckets.fail.withinTarget * 100.0) / 100.0);255failbucket.pushKV("totalconfirmed", round(buckets.fail.totalConfirmed * 100.0) / 100.0);256failbucket.pushKV("inmempool", round(buckets.fail.inMempool * 100.0) / 100.0);257failbucket.pushKV("leftmempool", round(buckets.fail.leftMempool * 100.0) / 100.0);259// CFeeRate(0) is used to indicate error as a return value from estimateRawFee260if (feeRate != CFeeRate(0)) {261horizon_result.pushKV("feerate", ValueFromAmount(feeRate.GetFeePerK()));262horizon_result.pushKV("decay", buckets.decay);263horizon_result.pushKV("scale", buckets.scale);264horizon_result.pushKV("pass", std::move(passbucket));265// buckets.fail.start == -1 indicates that all buckets passed, there is no fail bucket to output266if (buckets.fail.start != -1) horizon_result.pushKV("fail", std::move(failbucket));267} else {268// Output only information that is still meaningful in the event of error269horizon_result.pushKV("decay", buckets.decay);270horizon_result.pushKV("scale", buckets.scale);271horizon_result.pushKV("fail", std::move(failbucket));272errors.push_back("Insufficient data or no feerate found which meets threshold");273horizon_result.pushKV("errors", std::move(errors));274}275result.pushKV(StringForFeeEstimateHorizon(horizon), std::move(horizon_result));276}277return result;278},279};280}282void RegisterFeeRPCCommands(CRPCTable& t)283{284static const CRPCCommand commands[]{285{"util", &estimatesmartfee},286{"hidden", &estimaterawfee},287};288for (const auto& c : commands) {289t.appendCommand(c.name, &c);290}291}