Skip to content

Commit b5e2526

Browse files
committed
[zPIV] publicCoinSpend version field included in the serialization for any future change.
1 parent 46e453b commit b5e2526

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/zpiv/zpivmodule.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include "zpiv/zerocoin.h"
2020
#include "chainparams.h"
2121

22+
static int const COIN_SPEND_PUBLIC_SPEND_VERSION = 3;
23+
2224
class PublicCoinSpend : public libzerocoin::CoinSpend{
2325
public:
2426

@@ -30,6 +32,7 @@ class PublicCoinSpend : public libzerocoin::CoinSpend{
3032
this->randomness = randomness;
3133
this->pubkey = pubkey;
3234
this->spendType = libzerocoin::SpendType::SPEND;
35+
this->version = COIN_SPEND_PUBLIC_SPEND_VERSION;
3336
};
3437

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

43-
uint8_t getVersion() const { return libzerocoin::PrivateCoin::PUBKEY_VERSION; }
44-
4546
const uint256 signatureHash() const override;
4647
void setVchSig(std::vector<unsigned char> vchSig) { this->vchSig = vchSig; };
4748
bool Verify(const libzerocoin::Accumulator& a, bool verifyParams = true) const override;
@@ -58,6 +59,7 @@ class PublicCoinSpend : public libzerocoin::CoinSpend{
5859

5960
template <typename Stream, typename Operation>
6061
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
62+
READWRITE(version);
6163
READWRITE(coinSerialNumber);
6264
READWRITE(randomness);
6365
READWRITE(pubkey);

0 commit comments

Comments
 (0)