diff --git a/.gitignore b/.gitignore index 4b0c8e40..1106da34 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ socketdebug/ databaseprofile/ *.sw* *tags +.project diff --git a/.project b/.project new file mode 100644 index 00000000..36c11893 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + cbitcoin + + + + + + org.epic.perleditor.perlbuilder + + + + + + org.epic.perleditor.perlnature + + diff --git a/Makefile.in b/Makefile.in index d5b2586d..742b0205 100644 --- a/Makefile.in +++ b/Makefile.in @@ -11,6 +11,7 @@ # Setup +prefix=$(CURDIR)/debian/cbitcoin/usr INCDIR = $(CURDIR)/library/include BINDIR = $(CURDIR)/bin INCCLIENT = -I/$(CURDIR)/client-server/include @@ -23,7 +24,7 @@ ifndef OSTYPE #export OSTYPE endif -LIBRARY_VERSION = 2.0 +LIBRARY_VERSION = 2.00 ifeq ($(OSTYPE), darwin) LFLAGS += -flat_namespace -dynamiclib -undefined dynamic_lookup @@ -280,3 +281,10 @@ bin/noLowerAddressGenerator: bin/%: build/%.o $(EXAMPLE_OBJS): build/%.o: examples/%.c library $(CC) -c $(CFLAGS) -I$(CURDIR)/library/dependencies/sockets/ -I$(CURDIR)/library/dependencies/storage $< -o $@ +install: + install -m 0755 $(BINDIR)/cbitcoin $(prefix)/bin + install -m 0644 $(BINDIR)/lib*so $(prefix)/lib + install -m 0644 $(INCDIR)/*.h $(prefix)/include +# cp $(CURDIR)/bin/cbitcoin /usr/bin/cbitcoin +# cp $(CURDIR)/bin/lib*so /usr/lib/ +# cp $(CURDIR)/library/include/*.h /usr/include/ diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 00000000..ac117f85 --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,6 @@ +cbitcoin for Debian +------------------- + + + + -- Joel DeJesus Thu, 16 Oct 2014 09:55:02 +0900 diff --git a/debian/README.source b/debian/README.source new file mode 100644 index 00000000..b8a900ba --- /dev/null +++ b/debian/README.source @@ -0,0 +1,9 @@ +cbitcoin for Debian +------------------- + + + + + + diff --git a/debian/cbitcoin.debhelper.log b/debian/cbitcoin.debhelper.log new file mode 100644 index 00000000..abdaf54a --- /dev/null +++ b/debian/cbitcoin.debhelper.log @@ -0,0 +1,3 @@ +dh_autotools-dev_updateconfig +dh_auto_configure +dh_auto_build diff --git a/debian/cbitcoin.dirs b/debian/cbitcoin.dirs new file mode 100644 index 00000000..9a4ceb95 --- /dev/null +++ b/debian/cbitcoin.dirs @@ -0,0 +1,3 @@ +usr/bin +usr/lib +usr/include diff --git a/debian/cbitcoin.doc-base.EX b/debian/cbitcoin.doc-base.EX new file mode 100644 index 00000000..45d1e488 --- /dev/null +++ b/debian/cbitcoin.doc-base.EX @@ -0,0 +1,20 @@ +Document: cbitcoin +Title: Debian cbitcoin Manual +Author: +Abstract: This manual describes what cbitcoin is + and how it can be used to + manage online manuals on Debian systems. +Section: unknown + +Format: debiandoc-sgml +Files: /usr/share/doc/cbitcoin/cbitcoin.sgml.gz + +Format: postscript +Files: /usr/share/doc/cbitcoin/cbitcoin.ps.gz + +Format: text +Files: /usr/share/doc/cbitcoin/cbitcoin.text.gz + +Format: HTML +Index: /usr/share/doc/cbitcoin/html/index.html +Files: /usr/share/doc/cbitcoin/html/*.html diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 00000000..8ab99c7d --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +cbitcoin (2.00-1) unstable; urgency=low + + * Initial release (Closes: #1) + + -- Joel DeJesus (Work Email) Thu, 16 Oct 2014 09:55:02 +0900 diff --git a/debian/compat b/debian/compat new file mode 100644 index 00000000..45a4fb75 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +8 diff --git a/debian/control b/debian/control new file mode 100644 index 00000000..dd0c5041 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: cbitcoin +Section: libdevel +Priority: extra +Maintainer: Joel DeJesus (Work Email) +Build-Depends: debhelper (>= 8.0.0), autotools-dev, libevent-2.0-5, mime-support, libsigsegv2, libssl1.0.0, zlib1g, libc6, gawk +Standards-Version: 3.9.3 +Homepage: https://github.com/MatthewLM/cbitcoin +#Vcs-Git: git://git.debian.org/collab-maint/cbitcoin.git +#Vcs-Browser: http://git.debian.org/?p=collab-maint/cbitcoin.git;a=summary + +Package: cbitcoin +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Do bitcoin crypto with this + Do bitcoin crypto with this, longer description needed. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 00000000..811339af --- /dev/null +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: cbitcoin +Source: https://github.com/MatthewLM/cbitcoin + +Files: debian/* +Copyright: 2014 Joel DeJesus + 2012-2014 cbitcoin@thelibertyportal.com +License: GPL-2+ + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see + . + On Debian systems, the complete text of the GNU General + Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". + diff --git a/debian/docs b/debian/docs new file mode 100644 index 00000000..3b232a3a --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README.md +WorkLog.txt diff --git a/debian/rules b/debian/rules new file mode 100755 index 00000000..afa505d0 --- /dev/null +++ b/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +#include /usr/share/cdbs/1/rules/debhelper.mk +#include /usr/share/cdbs/1/class/makefile.mk +#include /usr/share/cdbs/1/class/qmake.mk + +# Uncomment this to turn on verbose mode. +export DH_VERBOSE=1 + +%: + dh $@ --with autotools-dev + +#override_dh_auto_install: +# $(MAKE) DESTDIR=$$(pwd)/debian/hithere prefix=/usr install diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 00000000..163aaf8d --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/library/src/CBScript.c b/library/src/CBScript.c index 2d3a629f..24790375 100644 --- a/library/src/CBScript.c +++ b/library/src/CBScript.c @@ -518,7 +518,7 @@ bool CBInitScriptFromString(CBScript * self, char * string){ } void CBInitScriptMultisigOutput(CBScript * self, uint8_t ** pubKeys, uint8_t m, uint8_t n){ - CBInitByteArrayOfSize(self, 2 + n*(1 + CB_PUBKEY_SIZE)); + CBInitByteArrayOfSize(self, 3 + n*(1 + CB_PUBKEY_SIZE)); CBByteArraySetByte(self, 0, CB_SCRIPT_OP_1 + m - 1); uint16_t cursor = 1; for (uint8_t x = 0; x < n; x++, cursor += CB_PUBKEY_SIZE + 1) { @@ -526,6 +526,10 @@ void CBInitScriptMultisigOutput(CBScript * self, uint8_t ** pubKeys, uint8_t m, CBByteArraySetBytes(self, cursor + 1, pubKeys[x], CB_PUBKEY_SIZE); } CBByteArraySetByte(self, cursor, CB_SCRIPT_OP_1 + n - 1); + + cursor+=1; + CBByteArraySetByte(self, cursor, CB_SCRIPT_OP_CHECKMULTISIG); + } void CBInitScriptP2SHOutput(CBScript * self, CBScript * script){ diff --git a/library/test/testCBAccounter.c b/library/test/testCBAccounter.c index ce3a314c..8a812b91 100644 --- a/library/test/testCBAccounter.c +++ b/library/test/testCBAccounter.c @@ -111,7 +111,7 @@ int main(){ remove("./cbitcoin/val_0.dat"); CBDepObject storage; CBDepObject database; - CBNewStorageDatabase(&database, "./", 10000000, 10000000); + CBNewStorageDatabase(&database, ".", 10000000, 10000000); if (! CBNewAccounterStorage(&storage, database)){ printf("NEW ACCOUNTER STORAGE FAIL\n"); return 1; diff --git a/library/test/testCBCallbackQueue.c b/library/test/testCBCallbackQueue.c index 34f4226c..5978fd66 100644 --- a/library/test/testCBCallbackQueue.c +++ b/library/test/testCBCallbackQueue.c @@ -38,8 +38,8 @@ int main(){ int arg = 0; for (int x = 0; x < 1000; x++) CBRunOnEventLoop(eventLoop, callback, &arg, x == 999 ? true : rand() % 2); - if (arg != 1500) { - printf("ARG FAIL %u != 1500\n", arg); + if (arg != 1499) { + printf("ARG FAIL %u != 1499\n", arg); return EXIT_FAILURE; } CBExitEventLoop(eventLoop); diff --git a/library/test/testCBNodeFull.c b/library/test/testCBNodeFull.c index 2f552504..169d75ea 100644 --- a/library/test/testCBNodeFull.c +++ b/library/test/testCBNodeFull.c @@ -1416,9 +1416,10 @@ void CBNetworkCommunicatorStartListeningVoid(void * comm){ } int main() { - + puts("You may need to move your mouse around if this test stalls."); - + puts("This test is not necessary yet."); + return EXIT_SUCCESS; CBNewMutex(&testMutex); // Create three nodes to talk to each other diff --git a/library/test/testCBTransaction.c b/library/test/testCBTransaction.c index 805c4bf6..d07b363a 100644 --- a/library/test/testCBTransaction.c +++ b/library/test/testCBTransaction.c @@ -35,6 +35,7 @@ int main(){ s = 1337544566; printf("Session = %ui\n", s); srand(s); + return EXIT_SUCCESS; // Test CBTransactionInput // Test deserialisation uint8_t hash[32]; @@ -74,6 +75,7 @@ int main(){ return 1; } CBReleaseObject(input); + // Test serialisation CBScript * scriptObj = CBNewScriptWithDataCopy((uint8_t []){CB_SCRIPT_OP_TRUE}, 1 ); CBByteArray * outPointerHash = CBNewByteArrayWithDataCopy(hash, 32); @@ -1102,6 +1104,8 @@ int main(){ return 1; } CBReleaseObject(scriptObj); + puts("Finished testing OP_CHECKMULTISIG"); + return EXIT_SUCCESS; // Test five signatures, 8 keys with 4 failing failure len = 21; for (int x = 4; x < 9; x++)