From c98ed16e3829d07bf65c914fb5baa206c1554eb0 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 18 Apr 2014 14:24:09 +1000 Subject: [PATCH] Move gbtbase_t to bitcoin header --- src/bitcoin.c | 1 + src/bitcoin.h | 23 +++++++++++++++++++++++ src/libckpool.h | 23 ----------------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/bitcoin.c b/src/bitcoin.c index 272dd2a0..7dd9a5e4 100644 --- a/src/bitcoin.c +++ b/src/bitcoin.c @@ -13,6 +13,7 @@ #include "ckpool.h" #include "libckpool.h" +#include "bitcoin.h" static const char *b58chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"; diff --git a/src/bitcoin.h b/src/bitcoin.h index e458d050..c10ea0a3 100644 --- a/src/bitcoin.h +++ b/src/bitcoin.h @@ -10,6 +10,29 @@ #ifndef BITCOIN_H #define BITCOIN_H +struct gbtbase { + uchar previousblockhash[32]; + uchar target[32]; + double sdiff; + uint32_t version; + uint32_t curtime; + uchar prev_hash[68]; + char ntime[12]; + char bbversion[12]; + char nbit[12]; + int nValue; + uint32_t bits; + int height; + char *txn_data; + uchar *txn_hashes; + int transactions; + int merkles; + uchar merklebin[16][32]; + char merklehash[16][68]; +}; + +typedef struct gbtbase gbtbase_t; + bool validate_address(connsock_t *cs, const char *address); bool gen_gbtbase(connsock_t *cs, gbtbase_t *gbt); int get_blockcount(connsock_t *cs); diff --git a/src/libckpool.h b/src/libckpool.h index 4c57188b..3e40bd9c 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -107,29 +107,6 @@ struct connsock { typedef struct connsock connsock_t; -struct gbtbase { - uchar previousblockhash[32]; - uchar target[32]; - double sdiff; - uint32_t version; - uint32_t curtime; - uchar prev_hash[68]; - char ntime[12]; - char bbversion[12]; - char nbit[12]; - int nValue; - uint32_t bits; - int height; - char *txn_data; - uchar *txn_hashes; - int transactions; - int merkles; - uchar merklebin[16][32]; - char merklehash[16][68]; -}; - -typedef struct gbtbase gbtbase_t; - void _mutex_lock(pthread_mutex_t *lock, const char *file, const char *func, const int line); void _mutex_unlock_noyield(pthread_mutex_t *lock, const char *file, const char *func, const int line); void _mutex_unlock(pthread_mutex_t *lock, const char *file, const char *func, const int line);