updated to support N-out-TX operation of Salvium v0.6.x
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define CURRENT_TRANSACTION_VERSION 2
|
||||
#define HF_VERSION_ENABLE_N_OUTS 2
|
||||
|
||||
#define PRICING_RECORD_VALID_TIME_DIFF_FROM_BLOCK 120 // seconds
|
||||
|
||||
|
||||
@@ -200,6 +200,10 @@ namespace cryptonote
|
||||
cryptonote::salvium_transaction_type type;
|
||||
// Return address
|
||||
crypto::public_key return_address;
|
||||
// Return address list (must be at least 1 and at most BULLETPROOF_MAX_OUTPUTS-1 - the "-1" is for the change output)
|
||||
std::vector<crypto::public_key> return_address_list;
|
||||
//return_address_change_mask
|
||||
std::vector<uint8_t> return_address_change_mask;
|
||||
// Return TX public key
|
||||
crypto::public_key return_pubkey;
|
||||
// Source asset type
|
||||
@@ -222,8 +226,13 @@ namespace cryptonote
|
||||
if (type != cryptonote::salvium_transaction_type::PROTOCOL) {
|
||||
VARINT_FIELD(amount_burnt)
|
||||
if (type != cryptonote::salvium_transaction_type::MINER) {
|
||||
FIELD(return_address)
|
||||
FIELD(return_pubkey)
|
||||
if (type == cryptonote::transaction_type::TRANSFER && version >= TRANSACTION_VERSION_N_OUTS) {
|
||||
FIELD(return_address_list)
|
||||
FIELD(return_address_change_mask)
|
||||
} else {
|
||||
FIELD(return_address)
|
||||
FIELD(return_pubkey)
|
||||
}
|
||||
FIELD(source_asset_type)
|
||||
FIELD(destination_asset_type)
|
||||
VARINT_FIELD(amount_slippage_limit)
|
||||
@@ -332,6 +341,8 @@ namespace cryptonote
|
||||
// Salvium-specific fields
|
||||
type = cryptonote::salvium_transaction_type::UNSET;
|
||||
return_address = null_pkey;
|
||||
return_address_list.clear();
|
||||
return_address_change_mask.clear();
|
||||
return_pubkey = null_pkey;
|
||||
source_asset_type.clear();
|
||||
destination_asset_type.clear();
|
||||
|
||||
@@ -264,7 +264,11 @@ namespace cryptonote
|
||||
blob = t_serializable_object_to_blob(static_cast<const block_header&>(b));
|
||||
crypto::hash tree_root_hash = get_tx_tree_hash(b);
|
||||
blob.append(reinterpret_cast<const char*>(&tree_root_hash), sizeof(tree_root_hash));
|
||||
blob.append(tools::get_varint_data(b.tx_hashes.size()+1));
|
||||
if (b.blob_type == BLOB_TYPE_CRYPTONOTE_SALVIUM) {
|
||||
blob.append(tools::get_varint_data(b.tx_hashes.size() + (b.major_version >= HF_VERSION_ENABLE_N_OUTS ? 2 : 1)));
|
||||
} else {
|
||||
blob.append(tools::get_varint_data(b.tx_hashes.size() + 1));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user