From 25167361d2b41d71a180a847f71ea40e2150d5d1 Mon Sep 17 00:00:00 2001 From: Andrey Samokhvalov Date: Tue, 22 Nov 2016 23:53:43 +0300 Subject: [PATCH] lnd: add sync logic in lnd main --- lnd.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lnd.go b/lnd.go index 51f6e8a97..d9f5f3f6a 100644 --- a/lnd.go +++ b/lnd.go @@ -67,6 +67,12 @@ func lndMain() error { } defer chanDB.Close() + // Synchronize the version of database and apply migration if needed. + if err := chanDB.SyncVersions(channeldb.DBVersions); err != nil { + fmt.Println("unable to sync versions: ", err) + return err + } + // Next load btcd's TLS cert for the RPC connection. If a raw cert was // specified in the config, then we'll se that directly. Otherwise, we // attempt to read the cert from the path specified in the config.