當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Bitcoin estimatesmartfee用法及代碼示例

比特幣(Bitcoin) RPC Util API中estimatesmartfee的用法及代碼示例。

用法:

estimatesmartfee conf_target ( "estimate_mode" )

估計交易在conf_target塊內開始確認所需的每千字節費用,並返回對其有效的塊數。使用BIP 141中定義的虛擬交易大小(見證數據已打折)。

參數1 - conf_target

類型:數字,必填

塊中的確認目標(1-1008)

參數2 - estimate_mode

類型:字符串,可選,默認= CONSERVATIVE

費用估算模式。

是否返回更保守的估計,這也可以滿足更長的曆史。保守的估計可能會返回較高的費用率,並且更可能足以滿足期望的目標,但對現行費用市場的短期下跌反應不大。必須為以下之一:“UNSET” “ECONOMICAL” “CONSERVATIVE”

返回結果

{
  "feerate" : x.x,     (numeric, optional) estimate fee rate in BTC/kB
  "errors": [ str... ] (json array of strings, optional) Errors encountered during processing
  "blocks" : n         (numeric) block number where estimate was found
}

示例

bitcoin-cli estimatesmartfee 6

相關用法


注:本文由純淨天空篩選整理自bitcoin.org大神的英文原創作品 Bitcoin estimatesmartfee。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。