bitcoin

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const CHECK_BTC_TX_IDS_KEY = "BTC_Mon:CheckNewBTCTxIds"
View Source
const CONFIRMED_BTC_TX_IDS_KEY = "BTC_Mon:ConfirmedBTCTxIds"

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorBTC

type AnchorBTC struct {
	Cache    *level.KVStore
	Db       database.ChainpointDatabase
	LnClient *lightning.LightningClient
	// contains filtered or unexported fields
}

func NewBTCAnchorEngine

func NewBTCAnchorEngine(state *types.AnchorState, config types.AnchorConfig, tendermintRpc *tendermint_rpc.RPC,
	database *database.ChainpointDatabase, cache *level.KVStore, LnClient *lightning.LightningClient, logger log.Logger, analytics *analytics2.UniversalAnalytics) *AnchorBTC

func (*AnchorBTC) AnchorReward

func (app *AnchorBTC) AnchorReward(CoreID string) error

AnchorReward : Send sats to last anchoring core

func (*AnchorBTC) AnchorToChain

func (app *AnchorBTC) AnchorToChain(startTxRange int64, endTxRange int64) error

AnchorToChain : StartAnchoring scans all CAL transactions since last anchor epoch and writes the merkle root to the Calendar and to bitcoin

func (*AnchorBTC) BeginTxMonitor

func (app *AnchorBTC) BeginTxMonitor(msgBytes []byte) error

BeginTxMonitor : Consumes a btctx message to initiate monitoring on all nodes

func (*AnchorBTC) BlockSyncMonitor

func (app *AnchorBTC) BlockSyncMonitor()

BlockSyncMonitor : maintains unlock of wallet while abci is running, updates height, runs confirmation loop

func (*AnchorBTC) CheckAnchor

func (app *AnchorBTC) CheckAnchor(btcmsg types.BtcTxMsg) error

func (*AnchorBTC) ConfirmAnchor

func (app *AnchorBTC) ConfirmAnchor(btcMonObj types.BtcMonMsg) error

ConfirmAnchor : consumes a btc mon message and issues a BTC-Confirm transaction along with completing btc proof generation

func (*AnchorBTC) FindAndRemoveBtcCheck

func (app *AnchorBTC) FindAndRemoveBtcCheck(aggRoot string) error

FindAndRemoveBtcCheck : remove all checks in case of btc tx failure

func (*AnchorBTC) GenerateBtcBatch

func (app *AnchorBTC) GenerateBtcBatch(proofIds []string, btcHeadState types.AnchorBtcHeadState) error

func (*AnchorBTC) GetBlockTree

func (app *AnchorBTC) GetBlockTree(btcTx types.TxID) (lnrpc.BlockDetails, merkletools.MerkleTree, int, error)

GetBlockTree : constructs block merkel tree with transaction as index

func (*AnchorBTC) GetTreeFromCalRange

func (app *AnchorBTC) GetTreeFromCalRange(startTxRange int64, endTxRange int64) (types.BtcAgg, error)

func (*AnchorBTC) IsInConfirmedTxs

func (app *AnchorBTC) IsInConfirmedTxs(anchorRoot string) (bool, types.TxID)

func (*AnchorBTC) LogError

func (app *AnchorBTC) LogError(err error) error

func (*AnchorBTC) MonitorBlocksForConfirmation

func (app *AnchorBTC) MonitorBlocksForConfirmation(startHeight int64, endHeight int64) error

MonitorBlocksForConfirmation : since LND can't retrieve confirmed Txs, search block by block

func (*AnchorBTC) MonitorConfirmedTx

func (app *AnchorBTC) MonitorConfirmedTx()

MonitorConfirmedTx : Begins anchor confirmation process when a Tx is in the mempool

func (*AnchorBTC) MonitorFailedAnchor

func (app *AnchorBTC) MonitorFailedAnchor()

FailedAnchorMonitor: ensures transactions reach btc chain within certain time limit

func (*AnchorBTC) ResetAnchor

func (app *AnchorBTC) ResetAnchor(startTxRange int64)

ResetAnchor ensures that anchoring will begin again in the next block

func (*AnchorBTC) SendBtcTx

func (app *AnchorBTC) SendBtcTx(anchorDataObj types.BtcAgg, height int64, start int64, end int64) (string, []byte, error)

SendBtcTx : sends btc tx to lnd and enqueues tx monitoring information

Jump to

Keyboard shortcuts

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