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
- func GetErrorBasedOnOutLength(out []interface{}, err error) error
- func GetTxVirtualSize(tx *jaxutil.Tx) int64
- type ToolsXt
- func (xt ToolsXt) ChainErrToGBTErrString(err error) string
- func (xt *ToolsXt) CreateTxRawResult(chainParams *chaincfg.Params, mtx *wire.MsgTx, txHash string, ...) (*jaxjson.TxRawResult, error)
- func (xt ToolsXt) CreateVinList(mtx *wire.MsgTx, age int32) []jaxjson.Vin
- func (xt ToolsXt) CreateVoutList(mtx *wire.MsgTx, chainParams *chaincfg.Params, ...) []jaxjson.Vout
- func (xt ToolsXt) DecodeTemplateID(templateID string) (*chainhash.Hash, int64, error)
- func (xt ToolsXt) EncodeTemplateID(prevHash *chainhash.Hash, lastGenerated time.Time) string
- func (xt ToolsXt) GetDifficultyRatio(bits uint32, params *chaincfg.Params) (float64, error)
- func (xt ToolsXt) MessageToHex(msg wire.Message) (string, error)
- func (xt ToolsXt) SoftForkStatus(state blockchain.ThresholdState) (string, error)
- func (xt ToolsXt) WitnessToHex(witness wire.TxWitness) []string
Constants ¶
const MaxProtocolVersion = 70002
MaxProtocolVersion is the max protocol version the server supports.
Variables ¶
This section is empty.
Functions ¶
func GetErrorBasedOnOutLength ¶ added in v0.4.0
func GetTxVirtualSize ¶
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 ¶
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 ¶
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 ¶
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 ¶
EncodeTemplateID encodes the passed details into an ID that can be used to uniquely identify a block template.
func (ToolsXt) GetDifficultyRatio ¶
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 ¶
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.