Versions in this module Expand all Collapse all v0 v0.0.2 Oct 3, 2016 Changes in this version + const Add + const InitialRevocationWindow + const MaxPendingPayments + const Settle + const Timeout + var ErrChanClosing = fmt.Errorf("channel is being closed, operation disallowed") + var ErrNoWindow = fmt.Errorf(...) + var ErrNotMine = errors.New("the passed output doesn't belong to the wallet") + var OP_CHECKSEQUENCEVERIFY byte = txscript.OP_NOP3 + var SequenceLockTimeMask = uint32(0x0000ffff) + var SequenceLockTimeSeconds = uint32(1 << 22) + func CommitSpendTimeout(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func CreateCommitTx(fundingOutput *wire.TxIn, selfKey, theirKey *btcec.PublicKey, ...) (*wire.MsgTx, error) + func CreateCooperativeCloseTx(fundingTxIn *wire.TxIn, ourBalance, theirBalance btcutil.Amount, ...) *wire.MsgTx + func DeriveRevocationPrivKey(commitPrivKey *btcec.PrivateKey, revokePreimage []byte) *btcec.PrivateKey + func DeriveRevocationPubkey(commitPubKey *btcec.PublicKey, revokePreimage []byte) *btcec.PublicKey + func DisableLog() + func FindScriptOutputIndex(tx *wire.MsgTx, script []byte) (bool, uint32) + func GenFundingPkScript(aPub, bPub []byte, amt int64) ([]byte, *wire.TxOut, error) + func RegisterWallet(driver *WalletDriver) error + func SetLogWriter(w io.Writer, level string) error + func SpendMultiSig(redeemScript, pubA, sigA, pubB, sigB []byte) [][]byte + func SupportedWallets() []string + func UseLogger(logger btclog.Logger) + type AddressType uint8 + const NestedWitnessPubKey + const PubKeyHash + const WitnessPubKey + type BlockChainIO interface + GetCurrentHeight func() (int32, error) + GetTransaction func(txid *wire.ShaHash) (*wire.MsgTx, error) + GetUtxo func(txid *wire.ShaHash, index uint32) (*wire.TxOut, error) + type ChannelContribution struct + ChangeOutputs []*wire.TxOut + CommitKey *btcec.PublicKey + CsvDelay uint32 + DeliveryAddress btcutil.Address + FundingAmount btcutil.Amount + Inputs []*wire.TxIn + MultiSigKey *btcec.PublicKey + RevocationKey *btcec.PublicKey + type ChannelReservation struct + func NewChannelReservation(capacity, fundingAmt btcutil.Amount, minFeeRate btcutil.Amount, ...) *ChannelReservation + func (r *ChannelReservation) Cancel() error + func (r *ChannelReservation) CompleteReservation(fundingInputScripts []*InputScript, commitmentSig []byte) error + func (r *ChannelReservation) CompleteReservationSingle(revocationKey *btcec.PublicKey, fundingPoint *wire.OutPoint, commitSig []byte) error + func (r *ChannelReservation) DispatchChan() <-chan *LightningChannel + func (r *ChannelReservation) FinalFundingTx() *wire.MsgTx + func (r *ChannelReservation) FinalizeReservation() (*LightningChannel, error) + func (r *ChannelReservation) FundingOutpoint() *wire.OutPoint + func (r *ChannelReservation) FundingRedeemScript() []byte + func (r *ChannelReservation) LocalCommitTx() *wire.MsgTx + func (r *ChannelReservation) OurContribution() *ChannelContribution + func (r *ChannelReservation) OurSignatures() ([]*InputScript, []byte) + func (r *ChannelReservation) ProcessContribution(theirContribution *ChannelContribution) error + func (r *ChannelReservation) ProcessSingleContribution(theirContribution *ChannelContribution) error + func (r *ChannelReservation) TheirContribution() *ChannelContribution + func (r *ChannelReservation) TheirSignatures() ([]*InputScript, []byte) + type Config struct + type ErrInsufficientFunds struct + func (e *ErrInsufficientFunds) Error() string + type ForceCloseSummary struct + CloseTx *wire.MsgTx + SelfOutpoint wire.OutPoint + SelfOutputMaturity uint32 + SelfOutputSignDesc *SignDescriptor + type InputScript struct + ScriptSig []byte + Witness [][]byte + type LightningChannel struct + Capacity btcutil.Amount + ForceCloseSignal chan struct{} + FundingRedeemScript []byte + LocalDeliveryScript []byte + RemoteDeliveryScript []byte + UnilateralCloseSignal chan struct{} + func NewLightningChannel(signer Signer, bio BlockChainIO, events chainntnfs.ChainNotifier, ...) (*LightningChannel, error) + func (lc *LightningChannel) AddHTLC(htlc *lnwire.HTLCAddRequest) uint32 + func (lc *LightningChannel) ChannelPoint() *wire.OutPoint + func (lc *LightningChannel) CompleteCooperativeClose(remoteSig []byte) (*wire.MsgTx, error) + func (lc *LightningChannel) DeleteState() error + func (lc *LightningChannel) ExtendRevocationWindow() (*lnwire.CommitRevocation, error) + func (lc *LightningChannel) ForceClose() (*ForceCloseSummary, error) + func (lc *LightningChannel) InitCooperativeClose() ([]byte, *wire.ShaHash, error) + func (lc *LightningChannel) PendingUpdates() bool + func (lc *LightningChannel) ReceiveHTLC(htlc *lnwire.HTLCAddRequest) uint32 + func (lc *LightningChannel) ReceiveHTLCSettle(preimage [32]byte, logIndex uint32) error + func (lc *LightningChannel) ReceiveNewCommitment(rawSig []byte, ourLogIndex uint32) error + func (lc *LightningChannel) ReceiveRevocation(revMsg *lnwire.CommitRevocation) ([]*PaymentDescriptor, error) + func (lc *LightningChannel) RevokeCurrentCommitment() (*lnwire.CommitRevocation, error) + func (lc *LightningChannel) SettleHTLC(preimage [32]byte) (uint32, error) + func (lc *LightningChannel) SignNextCommitment() ([]byte, uint32, error) + func (lc *LightningChannel) StateSnapshot() *channeldb.ChannelSnapshot + func (lc *LightningChannel) TimeoutHTLC() error + type LightningWallet struct + ChannelDB *channeldb.DB + Signer Signer + func NewLightningWallet(cdb *channeldb.DB, notifier chainntnfs.ChainNotifier, wallet WalletController, ...) (*LightningWallet, error) + func (l *LightningWallet) ActiveReservations() []*ChannelReservation + func (l *LightningWallet) GetIdentitykey() (*btcec.PrivateKey, error) + func (l *LightningWallet) InitChannelReservation(capacity, ourFundAmt btcutil.Amount, theirID [32]byte, numConfs uint16, ...) (*ChannelReservation, error) + func (l *LightningWallet) LockedOutpoints() []*wire.OutPoint + func (l *LightningWallet) ResetReservations() + func (l *LightningWallet) Shutdown() error + func (l *LightningWallet) Startup() error + type PaymentDescriptor struct + Amount btcutil.Amount + EntryType updateType + Index uint32 + ParentIndex uint32 + Payload []byte + RHash PaymentHash + RPreimage PaymentHash + Timeout uint32 + type PaymentHash [32]byte + type SignDescriptor struct + HashType txscript.SigHashType + InputIndex int + Output *wire.TxOut + PubKey *btcec.PublicKey + RedeemScript []byte + SigHashes *txscript.TxSigHashes + type Signer interface + ComputeInputScript func(tx *wire.MsgTx, signDesc *SignDescriptor) (*InputScript, error) + SignOutputRaw func(tx *wire.MsgTx, signDesc *SignDescriptor) ([]byte, error) + type Utxo struct + Value btcutil.Amount + type WalletController interface + ConfirmedBalance func(confs int32, witness bool) (btcutil.Amount, error) + FetchInputInfo func(prevOut *wire.OutPoint) (*wire.TxOut, error) + FetchRootKey func() (*btcec.PrivateKey, error) + GetPrivKey func(a btcutil.Address) (*btcec.PrivateKey, error) + ListUnspentWitness func(confirms int32) ([]*Utxo, error) + LockOutpoint func(o wire.OutPoint) + NewAddress func(addrType AddressType, change bool) (btcutil.Address, error) + NewRawKey func() (*btcec.PublicKey, error) + PublishTransaction func(tx *wire.MsgTx) error + SendOutputs func(outputs []*wire.TxOut) (*wire.ShaHash, error) + Start func() error + Stop func() error + UnlockOutpoint func(o wire.OutPoint) + type WalletDriver struct + New func(args ...interface{}) (WalletController, error) + WalletType string + func RegisteredWallets() []*WalletDriver