Skip to content

Commit

Permalink
Rm dead code + Bump version to v1.8.1
Browse files Browse the repository at this point in the history
Deleted some unused/uncalled code in Merkle.cpp.

Also bumped version to 1.8.1 in preparation for release
  • Loading branch information
cculianu committed Sep 18, 2022
1 parent f7513d2 commit c80bf1b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
2 changes: 1 addition & 1 deletion contrib/rpm/fulcrum.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: {{{ git_repo_name name="fulcrum" }}}
Version: 1.8.0
Version: 1.8.1
Release: {{{ git_repo_version }}}%{?dist}
Summary: A fast & nimble SPV server for Bitcoin Cash & Bitcoin BTC

Expand Down
4 changes: 2 additions & 2 deletions doc/unix-man-page.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% FULCRUM(1) Version 1.8.0 | Fulcrum Manual
% FULCRUM(1) Version 1.8.1 | Fulcrum Manual
% Fulcrum is written by Calin Culianu (cculianu)
% September 11, 2022
% September 18, 2022

# NAME

Expand Down
2 changes: 1 addition & 1 deletion src/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct InternalError : Exception { using Exception::Exception; ~InternalError()
struct BadArgs : Exception { using Exception::Exception; ~BadArgs() override; };

#define APPNAME "Fulcrum"
#define VERSION "1.8.0"
#define VERSION "1.8.1"
#ifdef QT_DEBUG
inline constexpr bool isReleaseBuild() { return false; }
#else
Expand Down
17 changes: 0 additions & 17 deletions src/Merkle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,23 +92,6 @@ namespace Merkle {
return ret;
}

Hash rootFromProof(const Hash & hashIn, const HashVec &branch, unsigned index)
{
Hash hash = hashIn; // shallow copy, working hash
for (const auto & h : branch) {
if (index & 1) // odd
hash = BTC::Hash(h + hash);
else
hash = BTC::Hash(hash + h);
index >>= 1;
}
if (index) {
Error() << __PRETTY_FUNCTION__ << ": INTERNAL ERROR. Passed-in index is out of range! FIXME!";
throw BadArgs(QString("%1: Index argument out of range").arg(__func__));
}
return hash;
}

HashVec level(const HashVec &hashes, unsigned depthHigher)
{
HashVec ret;
Expand Down
9 changes: 1 addition & 8 deletions src/Merkle.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,5 @@ namespace Merkle
HashVec levelFor(unsigned length) const; ///< takes no locks, may throw

};

// -- For Testing --

/// Used for testing. Return the merkle root given a hash, a merkle branch to it, and its index in the hashes array.
Hash rootFromProof(const Hash & hash, const HashVec &branch, unsigned index);
/// Used for testing.
void test();
};
} // namespace Merkle

0 comments on commit c80bf1b

Please sign in to comment.