rpcutli

package
v0.3.14 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2021 License: ISC Imports: 17 Imported by: 0

Documentation

Overview

Copyright (c) 2020 The JaxNetwork developers Use of this source code is governed by an ISC license that can be found in the LICENSE file.

Index

Constants

View Source
const MaxProtocolVersion = 70002

MaxProtocolVersion is the max protocol version the server supports.

Variables

This section is empty.

Functions

func GetTxVirtualSize

func GetTxVirtualSize(tx *jaxutil.Tx) int64

GetTxVirtualSize computes the virtual size of a given transaction. A transaction's virtual size is based off its weight, creating a discount for any witness data it contains, proportional to the current blockchain.WitnessScaleFactor value.

Types

type ToolsXt

type ToolsXt struct{}

func (ToolsXt) ChainErrToGBTErrString

func (xt ToolsXt) ChainErrToGBTErrString(err error) string

ChainErrToGBTErrString converts an error returned from btcchain to a string which matches the reasons and format described in BIP0022 for rejection reasons.

func (*ToolsXt) CreateTxRawResult

func (xt *ToolsXt) CreateTxRawResult(chainParams *chaincfg.Params, mtx *wire.MsgTx,
	txHash string, blkHeader wire.BlockHeader, blkHash string,
	blkHeight int32, chainHeight int32) (*jaxjson.TxRawResult, error)

CreateTxRawResult converts the passed transaction and associated parameters to a raw transaction JSON object.

func (ToolsXt) CreateVinList

func (xt ToolsXt) CreateVinList(mtx *wire.MsgTx, age int32) []jaxjson.Vin

CreateVinList returns a slice of JSON objects for the inputs of the passed transaction.

func (ToolsXt) CreateVoutList

func (xt ToolsXt) CreateVoutList(mtx *wire.MsgTx, chainParams *chaincfg.Params, filterAddrMap map[string]struct{}) []jaxjson.Vout

CreateVoutList returns a slice of JSON objects for the outputs of the passed transaction.

func (ToolsXt) DecodeTemplateID

func (xt ToolsXt) DecodeTemplateID(templateID string) (*chainhash.Hash, int64, error)

DecodeTemplateID decodes an ID that is used to uniquely identify a block template. This is mainly used as a mechanism to track when to update clients that are using long polling for block templates. The ID consists of the previous block hash for the associated template and the time the associated template was generated.

func (ToolsXt) EncodeTemplateID

func (xt ToolsXt) EncodeTemplateID(prevHash *chainhash.Hash, lastGenerated time.Time) string

EncodeTemplateID encodes the passed details into an ID that can be used to uniquely identify a block template.

func (ToolsXt) GetDifficultyRatio

func (xt ToolsXt) GetDifficultyRatio(bits uint32, params *chaincfg.Params) (float64, error)

GetDifficultyRatio returns the proof-of-work difficulty as a multiple of the minimum difficulty using the passed bits field from the header of a block.

func (ToolsXt) MessageToHex

func (xt ToolsXt) MessageToHex(msg wire.Message) (string, error)

MessageToHex serializes a message to the wire protocol encoding using the latest protocol version and returns a hex-encoded string of the result.

func (ToolsXt) SoftForkStatus

func (xt ToolsXt) SoftForkStatus(state blockchain.ThresholdState) (string, error)

SoftForkStatus converts a ThresholdState state into a human readable string corresponding to the particular state.

func (ToolsXt) WitnessToHex

func (xt ToolsXt) WitnessToHex(witness wire.TxWitness) []string

WitnessToHex formats the passed witness stack as a slice of hex-encoded strings to be used in a JSON response.

Jump to

Keyboard shortcuts

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