| 705 | } |
| 706 | |
| 707 | UniValue estimatepriority(const UniValue& params, bool fHelp) |
| 708 | { |
| 709 | if (fHelp || params.size() != 1) |
| 710 | throw runtime_error( |
| 711 | "estimatepriority nblocks\n" |
| 712 | "\nEstimates the approximate priority\n" |
| 713 | "a zero-fee transaction needs to begin confirmation\n" |
| 714 | "within nblocks blocks.\n" |
| 715 | "\nArguments:\n" |
| 716 | "1. nblocks (numeric)\n" |
| 717 | "\nResult:\n" |
| 718 | "n : (numeric) estimated priority\n" |
| 719 | "\n" |
| 720 | "-1.0 is returned if not enough transactions and\n" |
| 721 | "blocks have been observed to make an estimate.\n" |
| 722 | "\nExample:\n" |
| 723 | + HelpExampleCli("estimatepriority", "6") |
| 724 | ); |
| 725 | |
| 726 | RPCTypeCheck(params, boost::assign::list_of(UniValue::VNUM)); |
| 727 | |
| 728 | int nBlocks = params[0].get_int(); |
| 729 | if (nBlocks < 1) |
| 730 | nBlocks = 1; |
| 731 | |
| 732 | return mempool.estimatePriority(nBlocks); |
| 733 | } |
nothing calls this directly
no test coverage detected