From 036c291283553983d286537de15ff78afc07323f Mon Sep 17 00:00:00 2001 From: kanoi Date: Sun, 1 Jan 2017 14:32:00 +1100 Subject: [PATCH] ckdb/sql - increase the size of coinbase2 since core segwit changes before activation require a much larger coinbase --- sql/ckdb.sql | 2 +- sql/v1.0.7-v1.0.8.sql | 24 ++++++++++++++++++++++++ src/ckdb.h | 4 ++-- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 sql/v1.0.7-v1.0.8.sql diff --git a/sql/ckdb.sql b/sql/ckdb.sql index ee5908e1..76df068f 100644 --- a/sql/ckdb.sql +++ b/sql/ckdb.sql @@ -178,7 +178,7 @@ CREATE TABLE workinfo ( merklehash text DEFAULT ''::text NOT NULL, prevhash character varying(256) NOT NULL, coinbase1 character varying(256) NOT NULL, - coinbase2 character varying(256) NOT NULL, + coinbase2 character varying(511) NOT NULL, version character varying(64) NOT NULL, bits character varying(64) NOT NULL, ntime character varying(64) NOT NULL, diff --git a/sql/v1.0.7-v1.0.8.sql b/sql/v1.0.7-v1.0.8.sql new file mode 100644 index 00000000..19bfe622 --- /dev/null +++ b/sql/v1.0.7-v1.0.8.sql @@ -0,0 +1,24 @@ +SET SESSION AUTHORIZATION 'postgres'; + +BEGIN transaction; + +DO $$ +DECLARE ver TEXT; +BEGIN + + UPDATE version set version='1.0.8' where vlock=1 and version='1.0.7'; + + IF found THEN + RETURN; + END IF; + + SELECT version into ver from version + WHERE vlock=1; + + RAISE EXCEPTION 'Wrong DB version - expect "1.0.7" - found "%"', ver; + +END $$; + +ALTER TABLE workinfo ALTER COLUMN coinbase2 TYPE varchar(511); + +END transaction; diff --git a/src/ckdb.h b/src/ckdb.h index d42871f8..cdcf6d3a 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -57,8 +57,8 @@ * Consider adding row level locking (a per kitem usage count) if needed */ #define DB_VLOCK "1" -#define DB_VERSION "1.0.7" -#define CKDB_VERSION DB_VERSION"-2.717" +#define DB_VERSION "1.0.8" +#define CKDB_VERSION DB_VERSION"-2.718" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__