aboutsummaryrefslogtreecommitdiffstats
path: root/server.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-01-09 06:43:20 +0800
committerobscuren <geffobscura@gmail.com>2014-01-09 06:43:20 +0800
commit92b6667bd1cf7aad4a00331d761d8a92b03a7cae (patch)
tree01eba885b03343e576785082d90e3f786cf48261 /server.go
parent9f42835a0204ba2508895c1d259340bcda843974 (diff)
downloadgo-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.gz
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.bz2
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.lz
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.xz
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.tar.zst
go-tangerine-92b6667bd1cf7aad4a00331d761d8a92b03a7cae.zip
Minor update
Diffstat (limited to 'server.go')
-rw-r--r--server.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/server.go b/server.go
index c8fb492d5..d7718a8a6 100644
--- a/server.go
+++ b/server.go
@@ -5,11 +5,15 @@ import (
"time"
)
+var Db *LDBDatabase
+
type Server struct {
// Channel for shutting down the server
shutdownChan chan bool
// DB interface
db *LDBDatabase
+ // Block manager for processing new blocks and managing the block chain
+ blockManager *BlockManager
// Peers (NYI)
peers *list.List
}
@@ -20,8 +24,11 @@ func NewServer() (*Server, error) {
return nil, err
}
+ Db = db
+
server := &Server{
shutdownChan: make(chan bool),
+ blockManager: NewBlockManager(),
db: db,
peers: list.New(),
}
@@ -32,9 +39,11 @@ func NewServer() (*Server, error) {
// Start the server
func (s *Server) Start() {
// For now this function just blocks the main thread
- for {
- time.Sleep( time.Second )
- }
+ go func() {
+ for {
+ time.Sleep( time.Second )
+ }
+ }()
}
func (s *Server) Stop() {