cpfp

package
v0.3.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalCpfp

func CalCpfp(txID string, childTxSizeVb float64, desiredFeeRate float64) (string, float64, error)

CalCpfp 计算CPFP 必须参数 txID, desiredFeeRate 分别为目标txId以及目标的综合gas费 可选参数 childTxSizeVb 下一个交易的预估vb(虚拟大小=weight/4) 当 childTxSizeVb=0 时,此时操作视为rbf替换txID 对应的交易,所以计算的是当前txId对应的交易的新的feeRate 当 childTxSizeVb!=0时,此时操作视为为一个新的交易

Types

type Ancestor

type Ancestor struct {
	Txid   string `json:"txid"`
	Fee    int    `json:"fee"`
	Weight int    `json:"weight"`
}

type ResponseData

type ResponseData struct {
	Error                string     `json:"error"`
	Ancestors            []Ancestor `json:"ancestors"`
	Descendants          []Ancestor `json:"descendants"` // Assuming descendants have the same structure
	EffectiveFeePerVsize float64    `json:"effectiveFeePerVsize"`
	AdjustedVsize        float64    `json:"adjustedVsize"`
}

type Status

type Status struct {
	Confirmed bool `json:"confirmed"`
}

type TransactionDetail

type TransactionDetail struct {
	Txid   string `json:"txid"`
	Weight int    `json:"weight"`
	Fee    int    `json:"fee"`
	Status Status `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL