当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Bitcoin bumpfee用法及代码示例


比特币(Bitcoin) RPC Wallet API中bumpfee的用法及代码示例。

用法:

bumpfee "txid" ( options )

取消opt-in-RBF事务T的费用,将其替换为新事务B。

具有给定txid的opt-in RBF事务必须在钱包中。

该命令将通过减少(或删除)其更改输出来支付额外的费用。

如果更改输出的大小不足以支付增加的费用,则该命令当前将失败,而不是添加新的输入来进行补偿。 (将来的实现可能会改善此情况。)如果钱包或内存池包含花费T的输出之一的交易,则该命令将失败。

默认情况下,新费用将使用Estimatesmartfee自动计算。

用户可以为估算费用指定确认目标。

或者,用户可以指定totalFee,或使用RPC settxfee设置较高的费用率。

至少,新费用率必须足够高才能支付额外的新中继费用(getnetworkinfo返回的增量费)以进入节点的内存池。

参数1 - txid

类型:字符串,必填

txid被撞

参数2 - options

类型:json对象,可选

{
  "confTarget": n,           (numeric, optional, default=fallback to wallet's default) Confirmation target (in blocks)
  "totalFee": n,             (numeric, optional, default=fallback to 'confTarget') Total fee (NOT feerate) to pay, in satoshis.
                             In rare cases, the actual fee paid might be slightly higher than the specified
                             totalFee if the tx change output has to be removed because it is too close to
                             the dust threshold.
  "replaceable": bool,       (boolean, optional, default=true) Whether the new transaction should still be
                             marked bip-125 replaceable. If true, the sequence numbers in the transaction will
                             be left unchanged from the original. If false, any input sequence numbers in the
                             original transaction that were less than 0xfffffffe will be increased to 0xfffffffe
                             so the new transaction will not be explicitly bip-125 replaceable (though it may
                             still be replaceable in practice, for example if it has unconfirmed ancestors which
                             are replaceable).
  "estimate_mode": "str",    (string, optional, default=UNSET) The fee estimate mode, must be one of:
                             "UNSET"
                             "ECONOMICAL"
                             "CONSERVATIVE"
}

返回结果

{
  "txid":    "value",   (string)  The id of the new transaction
  "origfee":  n,         (numeric) Fee of the replaced transaction
  "fee":      n,         (numeric) Fee of the new transaction
  "errors":  [ str... ] (json array of strings) Errors encountered during processing (may be empty)
}

示例

收取费用,获取新交易的txid:

bitcoin-cli bumpfee <txid>

相关用法


注:本文由纯净天空筛选整理自bitcoin.org大神的英文原创作品 Bitcoin bumpfee。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。