Versions in this module Expand all Collapse all v0 v0.0.3 Sep 11, 2024 Changes in this version + const DefaultChannelCacheSize + const DefaultDBTimeout + const DefaultRejectCacheSize + const MaxAllowedExtraOpaqueBytes + const MaxMemoSize + const MaxPaymentRequestSize + const MaxReceiptSize + const VertexSize + var ErrEdgeNotFound = fmt.Errorf("edge not found") + var ErrEdgePolicyOptionalFieldNotFound = fmt.Errorf(...) + var ErrGraphNodeNotFound = fmt.Errorf("unable to find node") + var ErrGraphNotFound = fmt.Errorf("graph bucket not initialized") + var ErrNoClosedChannels = fmt.Errorf("no channel have been closed yet") + var ErrNoInvoicesCreated = fmt.Errorf("there are no existing invoices") + var ErrNoPaymentsCreated = fmt.Errorf("there are no existing payments") + var ErrNoRouteHopsProvided = fmt.Errorf("empty route hops provided") + var ErrSourceNodeNotSet = fmt.Errorf("source node does not exist") + var ErrUnknownAddressType = fmt.Errorf("address type cannot be resolved") + func ErrTooManyExtraOpaqueBytes(numBytes int) error + func MigrateEdgePolicies(tx kvdb.RwTx) error + func MigrateGossipMessageStoreKeys(tx kvdb.RwTx) error + func MigrateInvoiceTimeSeries(tx kvdb.RwTx) error + func MigrateInvoiceTimeSeriesOutgoingPayments(tx kvdb.RwTx) error + func MigrateInvoices(tx kvdb.RwTx) error + func MigrateNodeAndEdgeUpdateIndex(tx kvdb.RwTx) error + func MigrateOptionalChannelCloseSummaryFields(tx kvdb.RwTx) error + func MigrateOutgoingPayments(tx kvdb.RwTx) error + func MigratePruneEdgeUpdateIndex(tx kvdb.RwTx) error + func MigrateRouteSerialization(tx kvdb.RwTx) error + func PaymentStatusesMigration(tx kvdb.RwTx) error + func ReadChanConfig(b io.Reader, c *ChannelConfig) error + func ReadElement(r io.Reader, element interface{}) error + func ReadElements(r io.Reader, elements ...interface{}) error + func ReadOutpoint(r io.Reader, o *wire.OutPoint) error + func SerializeChanCommit(w io.Writer, c *ChannelCommitment) error + func SerializeHtlcs(b io.Writer, htlcs ...HTLC) error + func SerializeRoute(w io.Writer, r Route) error + func UseLogger(logger btclog.Logger) + func WriteChanConfig(b io.Writer, c *ChannelConfig) error + func WriteElement(w io.Writer, element interface{}) error + func WriteElements(w io.Writer, elements ...interface{}) error + func WriteOutpoint(w io.Writer, o *wire.OutPoint) error + type ChannelAuthProof struct + BitcoinSig1Bytes []byte + BitcoinSig2Bytes []byte + NodeSig1Bytes []byte + NodeSig2Bytes []byte + func (c *ChannelAuthProof) IsEmpty() bool + type ChannelCloseSummary struct + Capacity btcutil.Amount + ChainHash chainhash.Hash + ChanPoint wire.OutPoint + CloseHeight uint32 + CloseType ClosureType + ClosingTXID chainhash.Hash + IsPending bool + LastChanSyncMsg *lnwire.ChannelReestablish + LocalChanConfig ChannelConfig + RemoteCurrentRevocation *btcec.PublicKey + RemoteNextRevocation *btcec.PublicKey + RemotePub *btcec.PublicKey + SettledBalance btcutil.Amount + ShortChanID lnwire.ShortChannelID + TimeLockedBalance btcutil.Amount + type ChannelCommitment struct + CommitFee btcutil.Amount + CommitHeight uint64 + CommitSig []byte + CommitTx *wire.MsgTx + FeePerKw btcutil.Amount + Htlcs []HTLC + LocalBalance lnwire.MilliSatoshi + LocalHtlcIndex uint64 + LocalLogIndex uint64 + RemoteBalance lnwire.MilliSatoshi + RemoteHtlcIndex uint64 + RemoteLogIndex uint64 + func DeserializeChanCommit(r io.Reader) (ChannelCommitment, error) + type ChannelConfig struct + DelayBasePoint keychain.KeyDescriptor + HtlcBasePoint keychain.KeyDescriptor + MultiSigKey keychain.KeyDescriptor + PaymentBasePoint keychain.KeyDescriptor + RevocationBasePoint keychain.KeyDescriptor + type ChannelConstraints struct + ChanReserve btcutil.Amount + CsvDelay uint16 + DustLimit btcutil.Amount + MaxAcceptedHtlcs uint16 + MaxPendingAmount lnwire.MilliSatoshi + MinHTLC lnwire.MilliSatoshi + type ChannelEdgeInfo struct + AuthProof *ChannelAuthProof + BitcoinKey1Bytes [33]byte + BitcoinKey2Bytes [33]byte + Capacity btcutil.Amount + ChainHash chainhash.Hash + ChannelID uint64 + ChannelPoint wire.OutPoint + ExtraOpaqueData []byte + Features []byte + NodeKey1Bytes [33]byte + NodeKey2Bytes [33]byte + type ChannelEdgePolicy struct + ChannelFlags lnwire.ChanUpdateChanFlags + ChannelID uint64 + ExtraOpaqueData []byte + FeeBaseMSat lnwire.MilliSatoshi + FeeProportionalMillionths lnwire.MilliSatoshi + LastUpdate time.Time + MaxHTLC lnwire.MilliSatoshi + MessageFlags lnwire.ChanUpdateMsgFlags + MinHTLC lnwire.MilliSatoshi + Node *LightningNode + SigBytes []byte + TimeLockDelta uint16 + func (c *ChannelEdgePolicy) IsDisabled() bool + type ChannelGraph struct + func (c *ChannelGraph) SetSourceNode(node *LightningNode) error + func (c *ChannelGraph) SourceNode() (*LightningNode, error) + type ChannelStatus uint8 + var ChanStatusBorked ChannelStatus = 1 + var ChanStatusCommitBroadcasted ChannelStatus = 1 << 1 + var ChanStatusDefault ChannelStatus + var ChanStatusLocalDataLoss ChannelStatus = 1 << 2 + var ChanStatusRestored ChannelStatus = 1 << 3 + func (c ChannelStatus) String() string + type ChannelType uint8 + const SingleFunder + type CircuitKey struct + ChanID lnwire.ShortChannelID + HtlcID uint64 + func (k CircuitKey) String() string + type ClosureType uint8 + const RemoteForceClose + type ContractState uint8 + const ContractAccepted + const ContractCanceled + const ContractOpen + const ContractSettled + func (c ContractState) String() string + type ContractTerm struct + PaymentPreimage lntypes.Preimage + State ContractState + Value lnwire.MilliSatoshi + type DB struct + func Open(dbPath string, modifiers ...OptionModifier) (*DB, error) + func (d *DB) ChannelGraph() *ChannelGraph + func (d *DB) FetchAllInvoices(pendingOnly bool) ([]Invoice, error) + func (d *DB) FetchClosedChannels(pendingOnly bool) ([]*ChannelCloseSummary, error) + func (db *DB) FetchPayments() ([]*Payment, error) + type FailureReason byte + const FailureReasonError + const FailureReasonIncorrectPaymentDetails + const FailureReasonNoRoute + const FailureReasonTimeout + func (r FailureReason) String() string + type HTLC struct + Amt lnwire.MilliSatoshi + HtlcIndex uint64 + Incoming bool + LogIndex uint64 + OnionBlob []byte + OutputIndex int32 + RHash [32]byte + RefundTimeout uint32 + Signature []byte + func DeserializeHtlcs(r io.Reader) ([]HTLC, error) + type Hop struct + AmtToForward lnwire.MilliSatoshi + ChannelID uint64 + LegacyPayload bool + OutgoingTimeLock uint32 + PubKeyBytes Vertex + TLVRecords []tlv.Record + func (h *Hop) PackHopPayload(w io.Writer, nextChanID uint64) error + type HtlcState uint8 + type Invoice struct + AddIndex uint64 + AmtPaid lnwire.MilliSatoshi + CreationDate time.Time + Expiry time.Duration + FinalCltvDelta int32 + Htlcs map[CircuitKey]*InvoiceHTLC + Memo []byte + PaymentRequest []byte + Receipt []byte + SettleDate time.Time + SettleIndex uint64 + Terms ContractTerm + type InvoiceHTLC struct + AcceptHeight uint32 + AcceptTime time.Time + Amt lnwire.MilliSatoshi + Expiry uint32 + ResolveTime time.Time + State HtlcState + type LightningNode struct + Addresses []net.Addr + Alias string + AuthSigBytes []byte + Color color.RGBA + ExtraOpaqueData []byte + Features *lnwire.FeatureVector + HaveNodeAnnouncement bool + LastUpdate time.Time + PubKeyBytes [33]byte + func (l *LightningNode) PubKey() (*btcec.PublicKey, error) + type Meta struct + DbVersionNumber uint32 + type OpenChannel struct + Capacity btcutil.Amount + ChainHash chainhash.Hash + ChanType ChannelType + ChannelFlags lnwire.FundingFlag + Db *DB + FundingBroadcastHeight uint32 + FundingOutpoint wire.OutPoint + FundingTxn *wire.MsgTx + IdentityPub *btcec.PublicKey + IsInitiator bool + IsPending bool + LocalChanCfg ChannelConfig + LocalCommitment ChannelCommitment + NumConfsRequired uint16 + RemoteChanCfg ChannelConfig + RemoteCommitment ChannelCommitment + RemoteCurrentRevocation *btcec.PublicKey + RemoteNextRevocation *btcec.PublicKey + RevocationProducer shachain.Producer + RevocationStore shachain.Store + ShortChannelID lnwire.ShortChannelID + TotalMSatReceived lnwire.MilliSatoshi + TotalMSatSent lnwire.MilliSatoshi + func (c *OpenChannel) ShortChanID() lnwire.ShortChannelID + type OptionModifier func(*Options) + type Options struct + ChannelCacheSize int + DBTimeout time.Duration + NoFreelistSync bool + RejectCacheSize int + func DefaultOptions() Options + type Payment struct + Attempt *PaymentAttemptInfo + Failure *FailureReason + Info *PaymentCreationInfo + PaymentPreimage *lntypes.Preimage + Status PaymentStatus + type PaymentAttemptInfo struct + PaymentID uint64 + Route Route + SessionKey *btcec.PrivateKey + type PaymentCreationInfo struct + CreationDate time.Time + PaymentHash lntypes.Hash + PaymentRequest []byte + Value lnwire.MilliSatoshi + type PaymentStatus byte + const StatusFailed + const StatusInFlight + const StatusSucceeded + const StatusUnknown + func (ps *PaymentStatus) FromBytes(status []byte) error + func (ps PaymentStatus) Bytes() []byte + func (ps PaymentStatus) String() string + type Route struct + Hops []*Hop + SourcePubKey Vertex + TotalAmount lnwire.MilliSatoshi + TotalTimeLock uint32 + func DeserializeRoute(r io.Reader) (Route, error) + func NewRouteFromHops(amtToSend lnwire.MilliSatoshi, timeLock uint32, sourceVertex Vertex, ...) (*Route, error) + func (r *Route) HopFee(hopIndex int) lnwire.MilliSatoshi + func (r *Route) String() string + func (r *Route) ToSphinxPath() (*sphinx.PaymentPath, error) + func (r *Route) TotalFees() lnwire.MilliSatoshi + type UnknownElementType struct + func (e UnknownElementType) Error() string + type Vertex [VertexSize]byte + func NewVertex(pub *btcec.PublicKey) Vertex + func NewVertexFromBytes(b []byte) (Vertex, error) + func NewVertexFromStr(v string) (Vertex, error) + func (v Vertex) String() string