fundimport

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package fundimport takes coin the user already owns into a wallet's pool: the outputs of a mined transaction, paid from the user's own wallet to the fund address a command printed, imported by txid. It is the funding path on mainnet and testnet, where nobody running a command has coinbase.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotMined = errors.New("not mined yet; import it once it has a block")

ErrNotMined is a transaction the node has not placed in a block yet.

Functions

This section is empty.

Types

type Result

type Result struct {
	// TxID is the transaction imported.
	TxID string
	// Added is how many outputs entered the pool, Satoshis their sum.
	Added    int
	Satoshis uint64
	// Paying is how many outputs pay the fund address; Spent how many of
	// them the node shows spent already (left out); Held how many the pool
	// already held (left out).
	Paying int
	Spent  int
	Held   int
	// Height is the block the transaction is mined in.
	Height uint32
}

Result is what an import took.

func Import

func Import(ctx context.Context, s *bwallet.Signer, pool *bwallet.Pool, asset *nodeapi.Asset, headers chaintracker.ChainTracker, txid string) (Result, error)

Import fetches txid and its proof from the node's asset API, checks the proof against the header source, and adds every output that pays the signer's fund address, that the node shows unspent and that the pool does not hold, with the transaction and its proof so a later spend can carry its parent. An output whose spend the node cannot vouch for is an error and nothing is added: a coin added on no evidence could be one already spent.

Jump to

Keyboard shortcuts

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