mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
multi: fix make fmt
This commit is contained in:
@@ -52,8 +52,9 @@ func (k BreachKey) String() string {
|
||||
|
||||
// NewBreachHintAndKeyFromHash derives a BreachHint and BreachKey from a given
|
||||
// txid in a single pass. The hint and key are computed as:
|
||||
// hint = SHA256(txid)
|
||||
// key = SHA256(txid || txid)
|
||||
//
|
||||
// hint = SHA256(txid)
|
||||
// key = SHA256(txid || txid)
|
||||
func NewBreachHintAndKeyFromHash(hash *chainhash.Hash) (BreachHint, BreachKey) {
|
||||
var (
|
||||
hint BreachHint
|
||||
|
@@ -43,9 +43,10 @@ const (
|
||||
)
|
||||
|
||||
// Size returns the size of the encoded-and-encrypted blob in bytes.
|
||||
// nonce: 24 bytes
|
||||
// enciphered plaintext: n bytes
|
||||
// MAC: 16 bytes
|
||||
//
|
||||
// nonce: 24 bytes
|
||||
// enciphered plaintext: n bytes
|
||||
// MAC: 16 bytes
|
||||
func Size(blobType Type) int {
|
||||
return NonceSize + PlaintextSize(blobType) + CiphertextExpansion
|
||||
}
|
||||
@@ -173,7 +174,8 @@ func (b *JusticeKit) CommitToLocalWitnessScript() ([]byte, error) {
|
||||
|
||||
// CommitToLocalRevokeWitnessStack constructs a witness stack spending the
|
||||
// revocation clause of the commitment to-local output.
|
||||
// <revocation-sig> 1
|
||||
//
|
||||
// <revocation-sig> 1
|
||||
func (b *JusticeKit) CommitToLocalRevokeWitnessStack() ([][]byte, error) {
|
||||
toLocalSig, err := b.CommitToLocalSig.ToSignature()
|
||||
if err != nil {
|
||||
@@ -220,7 +222,8 @@ func (b *JusticeKit) CommitToRemoteWitnessScript() ([]byte, error) {
|
||||
// CommitToRemoteWitnessStack returns a witness stack spending the commitment
|
||||
// to-remote output, which consists of a single signature satisfying either the
|
||||
// legacy or anchor witness scripts.
|
||||
// <to-remote-sig>
|
||||
//
|
||||
// <to-remote-sig>
|
||||
func (b *JusticeKit) CommitToRemoteWitnessStack() ([][]byte, error) {
|
||||
toRemoteSig, err := b.CommitToRemoteSig.ToSignature()
|
||||
if err != nil {
|
||||
@@ -345,14 +348,15 @@ func (b *JusticeKit) decode(r io.Reader, blobType Type) error {
|
||||
// constant-size plaintext size of 274 bytes.
|
||||
//
|
||||
// blob version 0 plaintext encoding:
|
||||
// sweep address length: 1 byte
|
||||
// padded sweep address: 42 bytes
|
||||
// revocation pubkey: 33 bytes
|
||||
// local delay pubkey: 33 bytes
|
||||
// csv delay: 4 bytes
|
||||
// commit to-local revocation sig: 64 bytes
|
||||
// commit to-remote pubkey: 33 bytes, maybe blank
|
||||
// commit to-remote sig: 64 bytes, maybe blank
|
||||
//
|
||||
// sweep address length: 1 byte
|
||||
// padded sweep address: 42 bytes
|
||||
// revocation pubkey: 33 bytes
|
||||
// local delay pubkey: 33 bytes
|
||||
// csv delay: 4 bytes
|
||||
// commit to-local revocation sig: 64 bytes
|
||||
// commit to-remote pubkey: 33 bytes, maybe blank
|
||||
// commit to-remote sig: 64 bytes, maybe blank
|
||||
func (b *JusticeKit) encodeV0(w io.Writer) error {
|
||||
// Assert the sweep address length is sane.
|
||||
if len(b.SweepAddress) > MaxSweepAddrSize {
|
||||
@@ -416,14 +420,15 @@ func (b *JusticeKit) encodeV0(w io.Writer) error {
|
||||
// to-remote output.
|
||||
//
|
||||
// blob version 0 plaintext encoding:
|
||||
// sweep address length: 1 byte
|
||||
// padded sweep address: 42 bytes
|
||||
// revocation pubkey: 33 bytes
|
||||
// local delay pubkey: 33 bytes
|
||||
// csv delay: 4 bytes
|
||||
// commit to-local revocation sig: 64 bytes
|
||||
// commit to-remote pubkey: 33 bytes, maybe blank
|
||||
// commit to-remote sig: 64 bytes, maybe blank
|
||||
//
|
||||
// sweep address length: 1 byte
|
||||
// padded sweep address: 42 bytes
|
||||
// revocation pubkey: 33 bytes
|
||||
// local delay pubkey: 33 bytes
|
||||
// csv delay: 4 bytes
|
||||
// commit to-local revocation sig: 64 bytes
|
||||
// commit to-remote pubkey: 33 bytes, maybe blank
|
||||
// commit to-remote sig: 64 bytes, maybe blank
|
||||
func (b *JusticeKit) decodeV0(r io.Reader) error {
|
||||
// Read the sweep address length as a single byte.
|
||||
var sweepAddrLen uint8
|
||||
|
@@ -603,11 +603,11 @@ func (c *TowerClient) RegisterChannel(chanID lnwire.ChannelID) error {
|
||||
|
||||
// BackupState initiates a request to back up a particular revoked state. If the
|
||||
// method returns nil, the backup is guaranteed to be successful unless the:
|
||||
// - client is force quit,
|
||||
// - justice transaction would create dust outputs when trying to abide by the
|
||||
// negotiated policy, or
|
||||
// - breached outputs contain too little value to sweep at the target sweep fee
|
||||
// rate.
|
||||
// - client is force quit,
|
||||
// - justice transaction would create dust outputs when trying to abide by the
|
||||
// negotiated policy, or
|
||||
// - breached outputs contain too little value to sweep at the target sweep fee
|
||||
// rate.
|
||||
func (c *TowerClient) BackupState(chanID *lnwire.ChannelID,
|
||||
breachInfo *lnwallet.BreachRetribution,
|
||||
chanType channeldb.ChannelType) error {
|
||||
|
@@ -57,8 +57,8 @@ func (m *SecretKeyRing) DeriveKey(
|
||||
// sha256 of the resulting shared point serialized in compressed format. If k is
|
||||
// our private key, and P is the public key, we perform the following operation:
|
||||
//
|
||||
// sx := k*P
|
||||
// s := sha256(sx.SerializeCompressed())
|
||||
// sx := k*P
|
||||
// s := sha256(sx.SerializeCompressed())
|
||||
//
|
||||
// NOTE: This is part of the wtclient.ECDHKeyRing interface.
|
||||
func (m *SecretKeyRing) ECDH(keyDesc keychain.KeyDescriptor,
|
||||
|
@@ -203,8 +203,8 @@ func (s *Server) peerHandler() {
|
||||
|
||||
// handleClient processes a series watchtower messages sent by a client. The
|
||||
// client may either send:
|
||||
// * a single CreateSession message.
|
||||
// * a series of StateUpdate messages.
|
||||
// - a single CreateSession message.
|
||||
// - a series of StateUpdate messages.
|
||||
//
|
||||
// This method uses the server's peer map to ensure at most one peer using the
|
||||
// same session id can enter the main event loop. The connection will be
|
||||
|
Reference in New Issue
Block a user