cpfp

package
v0.3.12 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ancestor

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

type CalCpfpData added in v0.3.11

type CalCpfpData struct {
	DecentTxId     string
	VinFeeRate     float64
	MemPoolFeeRate float64
}

func CalCpfp

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

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

type ResponseData

type ResponseData struct {
	Error                string               `json:"error"`
	Ancestors            []*TransactionDetail `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"`
	Vin    []TransactionInput `json:"vin"`
	Weight int                `json:"weight"`
	Fee    int                `json:"fee"`
	Status Status             `json:"status"`
}

type TransactionInput added in v0.3.11

type TransactionInput struct {
	Txid string `json:"txid"`
	Vout int    `json:"vout"`
}

Jump to

Keyboard shortcuts

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