|
|
@ -45,8 +45,9 @@ |
|
|
|
#include "zcash/JoinSplit.hpp" |
|
|
|
#include "zcash/Proof.hpp" |
|
|
|
|
|
|
|
extern uint32_t ASSETCHAINS_MAGIC; |
|
|
|
extern std::string ASSETCHAINS_SELFIMPORT; |
|
|
|
#define JOINSPLIT_SIZE GetSerializeSize(JSDescription(), SER_NETWORK, PROTOCOL_VERSION) |
|
|
|
#define OUTPUTDESCRIPTION_SIZE GetSerializeSize(OutputDescription(), SER_NETWORK, PROTOCOL_VERSION) |
|
|
|
#define SPENDDESCRIPTION_SIZE GetSerializeSize(SpendDescription(), SER_NETWORK, PROTOCOL_VERSION) |
|
|
|
|
|
|
|
// Overwinter transaction version
|
|
|
|
static const int32_t OVERWINTER_TX_VERSION = 3; |
|
|
@ -252,7 +253,6 @@ public: |
|
|
|
JSDescription(): vpub_old(0), vpub_new(0) { } |
|
|
|
|
|
|
|
JSDescription( |
|
|
|
bool makeGrothProof, |
|
|
|
ZCJoinSplit& params, |
|
|
|
const uint256& joinSplitPubKey, |
|
|
|
const uint256& rt, |
|
|
@ -265,7 +265,6 @@ public: |
|
|
|
); |
|
|
|
|
|
|
|
static JSDescription Randomized( |
|
|
|
bool makeGrothProof, |
|
|
|
ZCJoinSplit& params, |
|
|
|
const uint256& joinSplitPubKey, |
|
|
|
const uint256& rt, |
|
|
@ -579,7 +578,7 @@ public: |
|
|
|
const CAmount valueBalance; |
|
|
|
const std::vector<SpendDescription> vShieldedSpend; |
|
|
|
const std::vector<OutputDescription> vShieldedOutput; |
|
|
|
const std::vector<JSDescription> vjoinsplit; |
|
|
|
const std::vector<JSDescription> vJoinSplit; |
|
|
|
const uint256 joinSplitPubKey; |
|
|
|
const joinsplit_sig_t joinSplitSig = {{0}}; |
|
|
|
const binding_sig_t bindingSig = {{0}}; |
|
|
@ -636,8 +635,8 @@ public: |
|
|
|
} |
|
|
|
if (nVersion >= 2) { |
|
|
|
auto os = WithVersion(&s, static_cast<int>(header)); |
|
|
|
::SerReadWrite(os, *const_cast<std::vector<JSDescription>*>(&vjoinsplit), ser_action); |
|
|
|
if (vjoinsplit.size() > 0) { |
|
|
|
::SerReadWrite(os, *const_cast<std::vector<JSDescription>*>(&vJoinSplit), ser_action); |
|
|
|
if (vJoinSplit.size() > 0) { |
|
|
|
READWRITE(*const_cast<uint256*>(&joinSplitPubKey)); |
|
|
|
READWRITE(*const_cast<joinsplit_sig_t*>(&joinSplitSig)); |
|
|
|
} |
|
|
@ -744,7 +743,7 @@ struct CMutableTransaction |
|
|
|
CAmount valueBalance; |
|
|
|
std::vector<SpendDescription> vShieldedSpend; |
|
|
|
std::vector<OutputDescription> vShieldedOutput; |
|
|
|
std::vector<JSDescription> vjoinsplit; |
|
|
|
std::vector<JSDescription> vJoinSplit; |
|
|
|
uint256 joinSplitPubKey; |
|
|
|
CTransaction::joinsplit_sig_t joinSplitSig = {{0}}; |
|
|
|
CTransaction::binding_sig_t bindingSig = {{0}}; |
|
|
@ -800,8 +799,8 @@ struct CMutableTransaction |
|
|
|
} |
|
|
|
if (nVersion >= 2) { |
|
|
|
auto os = WithVersion(&s, static_cast<int>(header)); |
|
|
|
::SerReadWrite(os, vjoinsplit, ser_action); |
|
|
|
if (vjoinsplit.size() > 0) { |
|
|
|
::SerReadWrite(os, vJoinSplit, ser_action); |
|
|
|
if (vJoinSplit.size() > 0) { |
|
|
|
READWRITE(joinSplitPubKey); |
|
|
|
READWRITE(joinSplitSig); |
|
|
|
} |
|
|
|