From df3976ca8ebd1c20f671ba0ac82537e6c0975073 Mon Sep 17 00:00:00 2001 From: myriadcoin Date: Thu, 9 Jul 2015 00:43:45 +0200 Subject: [PATCH] auxpow --- src/main.cpp | 11 +++++++++++ src/main.h | 11 +---------- src/version.h | 4 ++-- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 828e9992..1db43e93 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1135,6 +1135,17 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock // CBlock and CBlockIndex // +std::string CDiskBlockIndex::ToString() const +{ + std::string str = "CDiskBlockIndex("; + str += CBlockIndex::ToString(); + str += strprintf("\n hashBlock=%s, hashPrev=%s, hashParentBlock=%s)", + GetBlockHash().ToString().c_str(), + hashPrev.ToString().c_str(), + (auxpow.get() != NULL) ? auxpow->GetParentBlockHash(GetAlgo()).ToString().substr(0,20).c_str() : "-"); + return str; +} + bool WriteBlockToDisk(CBlock& block, CDiskBlockPos& pos) { // Open history file to append diff --git a/src/main.h b/src/main.h index a907172d..c2852b17 100644 --- a/src/main.h +++ b/src/main.h @@ -1061,7 +1061,6 @@ public: //CDiskBlockIndex(CBlockIndex* pindex) : CBlockIndex(*pindex) { // hashPrev = (pprev ? pprev->GetBlockHash() : 0); //} - explicit CDiskBlockIndex(CBlockIndex* pindex, boost::shared_ptr auxpow) : CBlockIndex(*pindex) { hashPrev = (pprev ? pprev->GetBlockHash() : 0); this->auxpow = auxpow; @@ -1105,15 +1104,7 @@ public: } - std::string ToString() const - { - std::string str = "CDiskBlockIndex("; - str += CBlockIndex::ToString(); - str += strprintf("\n hashBlock=%s, hashPrev=%s)", - GetBlockHash().ToString().c_str(), - hashPrev.ToString().c_str()); - return str; - } + std::string ToString() const; void print() const { diff --git a/src/version.h b/src/version.h index 3d1abacb..2b9c3049 100644 --- a/src/version.h +++ b/src/version.h @@ -26,13 +26,13 @@ extern const std::string CLIENT_DATE; // network protocol versioning // -static const int PROTOCOL_VERSION = 70002; +static const int PROTOCOL_VERSION = 70003; // intial proto version, to be increased after version/verack negotiation static const int INIT_PROTO_VERSION = 209; // disconnect from peers older than this proto version -static const int MIN_PEER_PROTO_VERSION = 209; +static const int MIN_PEER_PROTO_VERSION = 70002; // nTime field added to CAddress, starting with this version; // if possible, avoid requesting addresses nodes older than this