Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,12 @@ TARGET_SOURCES(${LIBDOGECOIN_NAME} PRIVATE
src/buffer.c
src/chacha20.c
src/context.c
src/compact_filter.c
src/cstr.c
src/ctaes.c
src/ecc.c
src/eckey.c
src/golomb.c
src/key.c
src/koinu.c
src/map.c
Expand Down Expand Up @@ -458,6 +460,12 @@ ENDIF()
ENDIF()
TARGET_SOURCES(${LIBDOGECOIN_NAME} PUBLIC
src/chainparams.c
# PUBLIC for the same reason as chainparams: these are const data
# referenced from the CLI targets, and a PRIVATE source is compiled only
# into the library. On a Windows DLL build the executables then cannot
# reach the arrays -- data symbols do not resolve across the DLL boundary
# without dllimport, and LIBDOGECOIN_API expands to nothing for consumers.
src/cf_checkpoints.c
)

IF(WIN32 AND USE_TPM2)
Expand Down Expand Up @@ -555,6 +563,8 @@ IF(USE_TESTS)
test/chacha20_tests.c
test/context_tests.c
test/cstr_tests.c
test/compact_filter_tests.c
test/golomb_tests.c
test/ecc_tests.c
test/hash_tests.c
test/key_tests.c
Expand Down Expand Up @@ -685,6 +695,7 @@ IF(WITH_NET)
)
TARGET_SOURCES(${LIBDOGECOIN_NAME} ${visibility}
src/bip37.c
src/cfheadersdb_file.c
src/headersdb_file.c
src/net.c
src/protocol.c
Expand All @@ -701,6 +712,7 @@ IF(WITH_NET)
ENDIF()
IF(USE_TESTS)
TARGET_SOURCES(tests ${visibility}
test/cfheadersdb_tests.c
test/net_tests.c
test/protocol_tests.c
test/spv_tests.c
Expand Down
11 changes: 11 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ noinst_HEADERS = \
include/dogecoin/byteswap.h \
include/dogecoin/chacha20.h \
include/dogecoin/chainparams.h \
include/dogecoin/cf_checkpoints.h \
include/dogecoin/compact_filter.h \
include/dogecoin/common.h \
include/dogecoin/cstr.h \
include/dogecoin/ctaes.h \
include/dogecoin/ecc.h \
include/dogecoin/eckey.h \
include/dogecoin/golomb.h \
include/dogecoin/hash.h \
include/dogecoin/key.h \
include/dogecoin/koinu.h \
Expand Down Expand Up @@ -108,10 +111,13 @@ libdogecoin_la_SOURCES = \
src/chacha20.c \
src/context.c \
src/chainparams.c \
src/cf_checkpoints.c \
src/compact_filter.c \
src/cstr.c \
src/ctaes.c \
src/ecc.c \
src/eckey.c \
src/golomb.c \
src/key.c \
src/koinu.c \
src/map.c \
Expand Down Expand Up @@ -282,6 +288,8 @@ tests_SOURCES = \
test/chacha20_tests.c \
test/context_tests.c \
test/cstr_tests.c \
test/compact_filter_tests.c \
test/golomb_tests.c \
test/ecc_tests.c \
test/hash_tests.c \
test/key_tests.c \
Expand Down Expand Up @@ -410,6 +418,7 @@ endif

if WITH_NET
noinst_HEADERS += \
include/dogecoin/cfheadersdb_file.h \
include/dogecoin/headersdb.h \
include/dogecoin/headersdb_file.h \
include/dogecoin/protocol.h \
Expand All @@ -418,6 +427,7 @@ noinst_HEADERS += \
include/dogecoin/spv.h

libdogecoin_la_SOURCES += \
src/cfheadersdb_file.c \
src/headersdb_file.c \
src/bip37.c \
src/net.c \
Expand All @@ -430,6 +440,7 @@ libdogecoin_la_CFLAGS += $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS)

if USE_TESTS
tests_SOURCES += \
test/cfheadersdb_tests.c \
test/net_tests.c \
test/protocol_tests.c \
test/spv_tests.c
Expand Down
69 changes: 69 additions & 0 deletions include/dogecoin/cf_checkpoints.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/*

The MIT License (MIT)

Copyright (c) 2018 Bitcoin Core developers
Copyright (c) 2026 bluezr
Copyright (c) 2026 The Dogecoin Foundation

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

*/

/**
* @file cf_checkpoints.h
* @brief BIP157 compact filter header checkpoints.
*
* Kept apart from chainparams so that several thousand lines of generated
* filter-header data do not sit in the middle of the chain parameter
* definitions, and so that adding block checkpoints and adding filter
* checkpoints touch different files.
*/

#ifndef __LIBDOGECOIN_CF_CHECKPOINTS_H__
#define __LIBDOGECOIN_CF_CHECKPOINTS_H__

#include <stddef.h>
#include <stdint.h>

#include <dogecoin/dogecoin.h>

LIBDOGECOIN_BEGIN_DECL

/**
* @brief BIP 157 compact filter header checkpoint.
*
* Filter header checkpoints at every CFCHECKPT_INTERVAL (1000) blocks.
*/
typedef struct dogecoin_cf_checkpoint_ {
uint32_t height; /**< Block height (multiple of CFCHECKPT_INTERVAL) */
const char* filter_header; /**< Filter header hash as 64-char hex string */
} dogecoin_cf_checkpoint;

/* BIP157 compact filter header checkpoints per network. */
extern const dogecoin_cf_checkpoint dogecoin_mainnet_cf_checkpoint_array[];
extern const size_t dogecoin_mainnet_cf_checkpoint_count;
extern const dogecoin_cf_checkpoint dogecoin_testnet_cf_checkpoint_array[];
extern const size_t dogecoin_testnet_cf_checkpoint_count;
extern const dogecoin_cf_checkpoint dogecoin_regtest_cf_checkpoint_array[];
extern const size_t dogecoin_regtest_cf_checkpoint_count;

LIBDOGECOIN_END_DECL

#endif /* __LIBDOGECOIN_CF_CHECKPOINTS_H__ */
Loading
Loading