From 03394d6309531e18282de0c53277f9548d6760c5 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 17 Jan 2014 00:48:32 -0600 Subject: [PATCH] Bring README.md and doc.go examples up to date. Since sqlite is now deprecated, update the examples to use levelb. Also, add false to the ProcessBlock calls for the fastAdd parameter. --- README.md | 6 +++--- doc.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a4704e31..42e67b80 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ intentionally causes an error by attempting to process a duplicate block. "fmt" "github.com/conformal/btcchain" "github.com/conformal/btcdb" - _ "github.com/conformal/btcdb/sqlite3" + _ "github.com/conformal/btcdb/ldb" "github.com/conformal/btcutil" "github.com/conformal/btcwire" "os" @@ -97,7 +97,7 @@ intentionally causes an error by attempting to process a duplicate block. // database. dbName := "example.db" _ = os.Remove(dbName) - db, err := btcdb.CreateDB("sqlite", dbName) + db, err := btcdb.CreateDB("leveldb", dbName) if err != nil { fmt.Printf("Failed to create database: %v\n", err) return @@ -122,7 +122,7 @@ intentionally causes an error by attempting to process a duplicate block. // Process a block. For this example, we are going to intentionally // cause an error by trying to process the genesis block which already // exists. - err = chain.ProcessBlock(genesisBlock) + err = chain.ProcessBlock(genesisBlock, false) if err != nil { fmt.Printf("Failed to process block: %v\n", err) return diff --git a/doc.go b/doc.go index 4138509e..33a27b80 100644 --- a/doc.go +++ b/doc.go @@ -72,7 +72,7 @@ intentionally causes an error by attempting to process a duplicate block. "fmt" "github.com/conformal/btcchain" "github.com/conformal/btcdb" - _ "github.com/conformal/btcdb/sqlite3" + _ "github.com/conformal/btcdb/ldb" "github.com/conformal/btcutil" "github.com/conformal/btcwire" "os" @@ -87,7 +87,7 @@ intentionally causes an error by attempting to process a duplicate block. // database. dbName := "example.db" _ = os.Remove(dbName) - db, err := btcdb.CreateDB("sqlite", dbName) + db, err := btcdb.CreateDB("leveldb", dbName) if err != nil { fmt.Printf("Failed to create database: %v\n", err) return