Remove circular dependancy on wallet creation.

This commit is contained in:
Josh Rickmar 2013-12-09 16:51:07 -05:00
parent 9be84e3489
commit 35a991e503

View file

@ -887,13 +887,6 @@ func BtcdHandshake(ws *websocket.Conn) error {
return errors.New("btcd and btcwallet running on different Bitcoin networks") 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 // Get current best block. If this is before than the oldest
// saved block hash, assume that this btcd instance is not yet // saved block hash, assume that this btcd instance is not yet
// synced up to a previous btcd that was last used with this // 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) NotifyNewBlockChainHeight(frontendNotificationMaster, bs.Height)
NotifyBalances(frontendNotificationMaster) 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 // TODO(jrick): if height is less than the earliest-saved block
// height, should probably wait for btcd to catch up. // height, should probably wait for btcd to catch up.