Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // TODO(roasbeef): replace w/ tesnet-L also revisit dependancy... ActiveNetParams = &chaincfg.TestNet3Params )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
Store... TODO(roasbeef): CHECKSUMS, REDUNDANCY, etc etc.
func (*DB) FetchOpenChannel ¶
func (c *DB) FetchOpenChannel(nodeID [32]byte) (*OpenChannel, error)
GetOpenChannel... TODO(roasbeef): assumes only 1 active channel per-node
func (*DB) GetIdAdr ¶
func (c *DB) GetIdAdr() (*btcutil.AddressPubKeyHash, error)
GetIdKey returns the IdKey
func (*DB) PutIdKey ¶
These don't really belong here but not sure which other file to put them yet. PutIdKey saves the private key used for
func (*DB) PutOpenChannel ¶
func (c *DB) PutOpenChannel(channel *OpenChannel) error
PutOpenChannel...
type OpenChannel ¶
type OpenChannel struct { // Hash? or Their current pubKey? // TODO(roasbeef): switch to Tadge's LNId TheirLNID [wire.HashSize]byte // The ID of a channel is the txid of the funding transaction. ChanID [wire.HashSize]byte MinFeePerKb btcutil.Amount // Keys for both sides to be used for the commitment transactions. OurCommitKey *btcec.PrivateKey TheirCommitKey *btcec.PublicKey // Tracking total channel capacity, and the amount of funds allocated // to each side. Capacity btcutil.Amount OurBalance btcutil.Amount TheirBalance btcutil.Amount // Commitment transactions for both sides (they're asymmetric). Our // commitment transaction includes a valid sigScript, and is ready for // broadcast. TheirCommitTx *wire.MsgTx OurCommitTx *wire.MsgTx // TODO(roasbeef): store hash instead? // The final funding transaction. Kept wallet-related records. FundingTx *wire.MsgTx MultiSigKey *btcec.PrivateKey FundingRedeemScript []byte // Current revocation for their commitment transaction. However, since // this is the hash, and not the pre-image, we can't yet verify that // it's actually in the chain. TheirCurrentRevocation [20]byte TheirShaChain *shachain.HyperShaChain OurShaChain *shachain.HyperShaChain // Final delivery address // TODO(roasbeef): should just be output scripts OurDeliveryAddress btcutil.Address TheirDeliveryAddress btcutil.Address // In blocks CsvDelay uint32 // TODO(roasbeef): track fees, other stats? NumUpdates uint64 TotalSatoshisSent uint64 TotalSatoshisReceived uint64 CreationTime time.Time }
OpenChannel... TODO(roasbeef): store only the essentials? optimize space... TODO(roasbeef): switch to "column store"
Source Files ¶
Click to show internal directories.
Click to hide internal directories.