From 35a991e50372e192f91d2d38a5c4c529d4d270ce Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 9 Dec 2013 16:51:07 -0500 Subject: [PATCH] Remove circular dependancy on wallet creation. --- sockets.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sockets.go b/sockets.go index 1670684..7478ed6 100644 --- a/sockets.go +++ b/sockets.go @@ -887,13 +887,6 @@ func BtcdHandshake(ws *websocket.Conn) error { return errors.New("btcd and btcwallet running on different Bitcoin networks") } - // Get default account. Only the default account is used to - // track recently-seen blocks. - a, err := accountstore.Account("") - if err != nil { - return fmt.Errorf("cannot get default account: %v", err) - } - // Get current best block. If this is before than the oldest // saved block hash, assume that this btcd instance is not yet // synced up to a previous btcd that was last used with this @@ -905,6 +898,13 @@ func BtcdHandshake(ws *websocket.Conn) error { NotifyNewBlockChainHeight(frontendNotificationMaster, bs.Height) NotifyBalances(frontendNotificationMaster) + // Get default account. Only the default account is used to + // track recently-seen blocks. + a, err := accountstore.Account("") + if err != nil { + return nil + } + // TODO(jrick): if height is less than the earliest-saved block // height, should probably wait for btcd to catch up.