Skip to content

Commit

Permalink
[zPIV] publicCoinSpend version field included in the serialization fo…
Browse files Browse the repository at this point in the history
…r any future change.
  • Loading branch information
furszy committed Jun 4, 2019
1 parent 46e453b commit b5e2526
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/zpiv/zpivmodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "zpiv/zerocoin.h"
#include "chainparams.h"

static int const COIN_SPEND_PUBLIC_SPEND_VERSION = 3;

class PublicCoinSpend : public libzerocoin::CoinSpend{
public:

Expand All @@ -30,6 +32,7 @@ class PublicCoinSpend : public libzerocoin::CoinSpend{
this->randomness = randomness;
this->pubkey = pubkey;
this->spendType = libzerocoin::SpendType::SPEND;
this->version = COIN_SPEND_PUBLIC_SPEND_VERSION;
};

template <typename Stream>
Expand All @@ -40,8 +43,6 @@ class PublicCoinSpend : public libzerocoin::CoinSpend{
this->spendType = libzerocoin::SpendType::SPEND;
}

uint8_t getVersion() const { return libzerocoin::PrivateCoin::PUBKEY_VERSION; }

const uint256 signatureHash() const override;
void setVchSig(std::vector<unsigned char> vchSig) { this->vchSig = vchSig; };
bool Verify(const libzerocoin::Accumulator& a, bool verifyParams = true) const override;
Expand All @@ -58,6 +59,7 @@ class PublicCoinSpend : public libzerocoin::CoinSpend{

template <typename Stream, typename Operation>
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(version);
READWRITE(coinSerialNumber);
READWRITE(randomness);
READWRITE(pubkey);
Expand Down

0 comments on commit b5e2526

Please sign in to comment.