Documentation ¶
Index ¶
Constants ¶
const ( // CstateInit means it hasn't been broadcast yet. CstateInit = 0 // CstateUnconfirmed means it's been broadcast but not included yet. CstateUnconfirmed = 1 // CstateOK means it's been included and the channel is active. CstateOK = 2 // CstateClosing means the close tx has been broadcast but not included yet. CstateClosing = 3 // CstateBreaking means it's the break tx has been broadcast but not included and spendable yet. CstateBreaking = 4 // CstateClosed means nothing else should be done with the channel anymore. CstateClosed = 5 // CstateError means something went horribly wrong and we may need extra intervention. CstateError = 255 )
Variables ¶
This section is empty.
Functions ¶
func AreCoinsCompatible ¶
func AreCoinsCompatible(a, b CoinSpecific) bool
AreCoinsCompatible checks to see if two coin-specific objects are for the same coin.
Types ¶
type ChannelHandle ¶
type ChannelHandle [64]byte
ChannelHandle is "something" to concisely uniquely identify a channel. Usually just a txid.
type ChannelInfo ¶
type ChannelInfo struct { PeerAddr string `json:"peeraddr"` CoinType int32 `json:"cointype"` State ChannelState `json:"state"` OpenTx []byte `json:"opentx"` // should this be here? OpenHeight int32 `json:"openheight"` // -1 if unconfirmed }
ChannelInfo .
type CoinAddress ¶
type CoinAddress struct {
// contains filtered or unexported fields
}
type CoinSpecific ¶
CoinSpecific is a meta-interface for coin-specific types.
type LitChannelStorage ¶
type LitChannelStorage interface { GetChannel(handle ChannelHandle) (*ChannelInfo, error) GetChannelHandles() ([]ChannelHandle, error) GetChannels() ([]ChannelInfo, error) AddChannel(handle ChannelHandle, info ChannelInfo) error UpdateChannel(handle ChannelHandle, info ChannelInfo) error ArchiveChannel(handle ChannelHandle) error GetArchivedChannelHandles() ([]ChannelHandle, error) }
LitChannelStorage .
type LitPeerStorage ¶
type LitPeerStorage interface { GetPeerAddrs() ([]LnAddr, error) GetPeerInfo(addr LnAddr) (*PeerInfo, error) GetPeerInfos() (map[LnAddr]PeerInfo, error) AddPeer(addr LnAddr, pi PeerInfo) error UpdatePeer(addr LnAddr, pi *PeerInfo) error DeletePeer(addr LnAddr) error // TEMP Until we figure this all out. GetUniquePeerIdx() (uint32, error) }
LitPeerStorage is storage for peer data.
type LitStorage ¶
type LitStorage interface { Open(dbpath string) error IsSingleFile() bool Close() error GetWalletDB(uint32) LitWalletStorage GetPeerDB() LitPeerStorage GetChannelDB() LitChannelStorage Check() error }
LitStorage is an abstract wrapper layer around an arbitrary database.
type LitWalletStorage ¶
type LitWalletStorage interface { CoinSpecific GetAddresses() ([]CoinAddress, error) GetUtxos() ([]Utxo, error) AddUtxo(Utxo) error RemoveUtxo(Utxo) error }
LitWalletStorage is storage for wallet data.
type LnAddr ¶
type LnAddr string
LnAddr is just a bech32-encoded pubkey. TODO Move this to another package so it's more obviously not *just* IO-related.
func ParseLnAddr ¶
ParseLnAddr will verify that the string passed is a valid LN address, as in ln1pmclh89haeswrw0unf8awuyqeu4t2uell58nea.
type PeerInfo ¶
type PeerInfo struct { LnAddr *LnAddr `json:"lnaddr"` Nickname *string `json:"name"` NetAddr *string `json:"netaddr"` // ip address, port, I guess // TEMP This is again, for adapting to the old system. PeerIdx uint32 `json:"hint_peeridx"` }
PeerInfo .