mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 06:21:40 +01:00
multi: formatting changes
This commit is contained in:
parent
0f167fd03e
commit
545e84f4ce
6 changed files with 9 additions and 19 deletions
|
@ -1891,7 +1891,7 @@ func (k *CircuitKey) SetBytes(bs []byte) error {
|
|||
|
||||
// Bytes returns the serialized bytes for this circuit key.
|
||||
func (k CircuitKey) Bytes() []byte {
|
||||
var bs = make([]byte, 16)
|
||||
bs := make([]byte, 16)
|
||||
binary.BigEndian.PutUint64(bs[:8], k.ChanID.ToUint64())
|
||||
binary.BigEndian.PutUint64(bs[8:], k.HtlcID)
|
||||
return bs
|
||||
|
@ -3468,7 +3468,6 @@ func putChanCommitments(chanBucket kvdb.RwBucket, channel *OpenChannel) error {
|
|||
}
|
||||
|
||||
func putChanRevocationState(chanBucket kvdb.RwBucket, channel *OpenChannel) error {
|
||||
|
||||
var b bytes.Buffer
|
||||
err := WriteElements(
|
||||
&b, channel.RemoteCurrentRevocation, channel.RevocationProducer,
|
||||
|
@ -3659,7 +3658,6 @@ func fetchChanRevocationState(chanBucket kvdb.RBucket, channel *OpenChannel) err
|
|||
}
|
||||
|
||||
func deleteOpenChannel(chanBucket kvdb.RwBucket) error {
|
||||
|
||||
if err := chanBucket.Delete(chanInfoKey); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -3682,7 +3680,6 @@ func deleteOpenChannel(chanBucket kvdb.RwBucket) error {
|
|||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
// makeLogKey converts a uint64 into an 8 byte array.
|
||||
|
|
|
@ -862,7 +862,6 @@ func (c *ChannelGraph) deleteLightningNode(nodes kvdb.RwBucket,
|
|||
}
|
||||
|
||||
if err := nodes.Delete(compressedPubKey); err != nil {
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -980,7 +979,6 @@ func (c *ChannelGraph) addChannelEdge(tx kvdb.RwTx, edge *ChannelEdgeInfo) error
|
|||
if err != nil {
|
||||
return fmt.Errorf("unable to create shell node "+
|
||||
"for: %x", edge.NodeKey1Bytes)
|
||||
|
||||
}
|
||||
case node1Err != nil:
|
||||
return err
|
||||
|
@ -997,7 +995,6 @@ func (c *ChannelGraph) addChannelEdge(tx kvdb.RwTx, edge *ChannelEdgeInfo) error
|
|||
if err != nil {
|
||||
return fmt.Errorf("unable to create shell node "+
|
||||
"for: %x", edge.NodeKey2Bytes)
|
||||
|
||||
}
|
||||
case node2Err != nil:
|
||||
return err
|
||||
|
@ -1012,11 +1009,12 @@ func (c *ChannelGraph) addChannelEdge(tx kvdb.RwTx, edge *ChannelEdgeInfo) error
|
|||
|
||||
// Mark edge policies for both sides as unknown. This is to enable
|
||||
// efficient incoming channel lookup for a node.
|
||||
for _, key := range []*[33]byte{&edge.NodeKey1Bytes,
|
||||
&edge.NodeKey2Bytes} {
|
||||
|
||||
err := putChanEdgePolicyUnknown(edges, edge.ChannelID,
|
||||
key[:])
|
||||
keys := []*[33]byte{
|
||||
&edge.NodeKey1Bytes,
|
||||
&edge.NodeKey2Bytes,
|
||||
}
|
||||
for _, key := range keys {
|
||||
err := putChanEdgePolicyUnknown(edges, edge.ChannelID, key[:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -2468,7 +2466,6 @@ func updateEdgePolicy(tx kvdb.RwTx, edge *ChannelEdgePolicy,
|
|||
edges := tx.ReadWriteBucket(edgeBucket)
|
||||
if edges == nil {
|
||||
return false, ErrEdgeNotFound
|
||||
|
||||
}
|
||||
edgeIndex := edges.NestedReadWriteBucket(edgeIndexBucket)
|
||||
if edgeIndex == nil {
|
||||
|
@ -3125,7 +3122,8 @@ func (c *ChannelEdgeInfo) OtherNodeKeyBytes(thisNodeKey []byte) (
|
|||
// the target node in the channel. This is useful when one knows the pubkey of
|
||||
// one of the nodes, and wishes to obtain the full LightningNode for the other
|
||||
// end of the channel.
|
||||
func (c *ChannelEdgeInfo) FetchOtherNode(tx kvdb.RTx, thisNodeKey []byte) (*LightningNode, error) {
|
||||
func (c *ChannelEdgeInfo) FetchOtherNode(tx kvdb.RTx,
|
||||
thisNodeKey []byte) (*LightningNode, error) {
|
||||
|
||||
// Ensure that the node passed in is actually a member of the channel.
|
||||
var targetNodeBytes [33]byte
|
||||
|
|
|
@ -315,7 +315,6 @@ func fetchPayment(bucket kvdb.RBucket) (*MPPayment, error) {
|
|||
creationInfo, err := fetchCreationInfo(bucket)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
}
|
||||
|
||||
var htlcs []HTLCAttempt
|
||||
|
|
|
@ -285,7 +285,6 @@ func extraArgsEtcd(etcdCfg *etcd.Config, name string, cluster bool) []string {
|
|||
|
||||
if etcdCfg.InsecureSkipVerify {
|
||||
extraArgs = append(extraArgs, "--db.etcd.insecure_skip_verify")
|
||||
|
||||
}
|
||||
|
||||
if cluster {
|
||||
|
@ -619,7 +618,6 @@ func (n *NetworkHarness) EnsureConnected(t *testing.T, a, b *HarnessNode) {
|
|||
predErr = err
|
||||
return false
|
||||
}
|
||||
|
||||
}, DefaultTimeout)
|
||||
if err != nil {
|
||||
return fmt.Errorf("connection not succeeded within 15 "+
|
||||
|
|
|
@ -570,7 +570,6 @@ func assertNotConnected(t *harnessTest, alice, bob *lntest.HarnessNode) {
|
|||
}
|
||||
|
||||
return nil
|
||||
|
||||
}, defaultTimeout)
|
||||
require.NoError(t.t, err)
|
||||
}
|
||||
|
|
|
@ -122,7 +122,6 @@ func WritePublicKey(buf *bytes.Buffer, pub *btcec.PublicKey) error {
|
|||
|
||||
serializedPubkey := pub.SerializeCompressed()
|
||||
return WriteBytes(buf, serializedPubkey)
|
||||
|
||||
}
|
||||
|
||||
// WriteChannelID appends the ChannelID to the provided buffer.
|
||||
|
|
Loading…
Add table
Reference in a new issue