Skip to content

Commit

Permalink
p2p: fix node update
Browse files Browse the repository at this point in the history
  • Loading branch information
inciner8r committed Apr 14, 2024
1 parent 64588a4 commit 6df7c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/p2p-Node/p2p-node.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func Init() {
if err := ha.Connect(ctx, *peerInfo); err != nil {
fmt.Printf("Failed to connect to peer %s: %s\n", peerInfo.ID.String(), err)
node.Status = "inactive"
if err := db.Model(&models.Node{}).Save(&node).Error; err != nil {
if err := db.Model(&models.Node{}).Where("id = ?", node.Id).Save(&node).Error; err != nil {
logrus.Error("failed to update node: ", err.Error())
continue
}
Expand Down

0 comments on commit 6df7c14

Please sign in to comment.