MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / estimatefee

Function estimatefee

src/rpcmining.cpp:675–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

673}
674
675UniValue estimatefee(const UniValue& params, bool fHelp)
676{
677 if (fHelp || params.size() != 1)
678 throw runtime_error(
679 "estimatefee nblocks\n"
680 "\nEstimates the approximate fee per kilobyte\n"
681 "needed for a transaction to begin confirmation\n"
682 "within nblocks blocks.\n"
683 "\nArguments:\n"
684 "1. nblocks (numeric)\n"
685 "\nResult:\n"
686 "n : (numeric) estimated fee-per-kilobyte\n"
687 "\n"
688 "-1.0 is returned if not enough transactions and\n"
689 "blocks have been observed to make an estimate.\n"
690 "\nExample:\n"
691 + HelpExampleCli("estimatefee", "6")
692 );
693
694 RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM));
695
696 int nBlocks = params[0].get_int();
697 if (nBlocks < 1)
698 nBlocks = 1;
699
700 CFeeRate feeRate = mempool.estimateFee(nBlocks);
701 if (feeRate == CFeeRate(0))
702 return -1.0;
703
704 return ValueFromAmount(feeRate.GetFeePerK());
705}
706
707UniValue estimatepriority(const UniValue& params, bool fHelp)
708{

Callers

nothing calls this directly

Calls 8

HelpExampleCliFunction · 0.85
RPCTypeCheckFunction · 0.85
ValueFromAmountFunction · 0.85
get_intMethod · 0.80
GetFeePerKMethod · 0.80
CFeeRateClass · 0.70
sizeMethod · 0.45
estimateFeeMethod · 0.45

Tested by

no test coverage detected