mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-05 18:03:09 +02:00
graph/db: add comment and switch to length check
Use a length check to determine if a bitcoin signature has been set or not. Also add a clarifying comment to explain why we only need to check if one signature field is set to determine if we have the auth proof for the channel or not.
This commit is contained in:
@@ -1702,7 +1702,10 @@ func getAndBuildEdgeInfo(ctx context.Context, db SQLQueries,
|
||||
ExtraOpaqueData: recs,
|
||||
}
|
||||
|
||||
if dbChan.Bitcoin1Signature != nil {
|
||||
// We always set all the signatures at the same time, so we can
|
||||
// safely check if one signature is present to determine if we have the
|
||||
// rest of the signatures for the auth proof.
|
||||
if len(dbChan.Bitcoin1Signature) > 0 {
|
||||
channel.AuthProof = &models.ChannelAuthProof{
|
||||
NodeSig1Bytes: dbChan.Node1Signature,
|
||||
NodeSig2Bytes: dbChan.Node2Signature,
|
||||
|
Reference in New Issue
Block a user