forked from lthn/blockchain
gcc fix, changed reference to pointer
This commit is contained in:
parent
24ce9d4b40
commit
8077c3e892
5 changed files with 17 additions and 13 deletions
|
|
@ -1412,7 +1412,7 @@ bool blockchain_storage::create_block_template(const account_public_address& min
|
|||
wide_difficulty_type& diffic,
|
||||
uint64_t& height) const
|
||||
{
|
||||
return create_block_template(miner_address, miner_address, ex_nonce, false, pos_entry(), nullptr, b, diffic, height, crypto::scalar_t());
|
||||
return create_block_template(miner_address, miner_address, ex_nonce, false, pos_entry(), nullptr, b, diffic, height);
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
bool blockchain_storage::create_block_template(const account_public_address& miner_address,
|
||||
|
|
@ -1424,7 +1424,7 @@ bool blockchain_storage::create_block_template(const account_public_address& min
|
|||
block& b,
|
||||
wide_difficulty_type& diffic,
|
||||
uint64_t& height,
|
||||
crypto::scalar_t& blinding_mask_sum /* = crypto::scalar_t */) const
|
||||
crypto::scalar_t* blinding_mask_sum_ptr /* = nullptr */) const
|
||||
{
|
||||
create_block_template_params params = AUTO_VAL_INIT(params);
|
||||
params.miner_address = miner_address;
|
||||
|
|
@ -1439,7 +1439,8 @@ bool blockchain_storage::create_block_template(const account_public_address& min
|
|||
b = resp.b;
|
||||
diffic = resp.diffic;
|
||||
height = resp.height;
|
||||
blinding_mask_sum = resp.blinding_mask_sum;
|
||||
if (blinding_mask_sum_ptr)
|
||||
*blinding_mask_sum_ptr = resp.blinding_mask_sum;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
@ -1524,7 +1525,7 @@ bool blockchain_storage::create_block_template(const create_block_template_param
|
|||
CURRENCY_MINER_TX_MAX_OUTS,
|
||||
pos,
|
||||
pe,
|
||||
resp.blinding_mask_sum);
|
||||
&resp.blinding_mask_sum);
|
||||
CHECK_AND_ASSERT_MES(r, false, "Failed to construc miner tx, first chance");
|
||||
uint64_t coinbase_size = get_object_blobsize(b.miner_tx);
|
||||
// "- 100" - to reserve room for PoS additions into miner tx
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ namespace currency
|
|||
|
||||
|
||||
bool create_block_template(const account_public_address& miner_address, const blobdata& ex_nonce, block& b, wide_difficulty_type& di, uint64_t& height) const;
|
||||
bool create_block_template(const account_public_address& miner_address, const account_public_address& stakeholder_address, const blobdata& ex_nonce, bool pos, const pos_entry& pe, fill_block_template_func_t custom_fill_block_template_func, block& b, wide_difficulty_type& di, uint64_t& height, crypto::scalar_t& blinding_mask_sum = crypto::scalar_t()) const;
|
||||
bool create_block_template(const account_public_address& miner_address, const account_public_address& stakeholder_address, const blobdata& ex_nonce, bool pos, const pos_entry& pe, fill_block_template_func_t custom_fill_block_template_func, block& b, wide_difficulty_type& di, uint64_t& height, crypto::scalar_t* blinding_mask_sum_ptr = nullptr) const;
|
||||
bool create_block_template(const create_block_template_params& params, create_block_template_response& resp) const;
|
||||
|
||||
bool have_block(const crypto::hash& id) const;
|
||||
|
|
|
|||
|
|
@ -183,11 +183,11 @@ namespace currency
|
|||
const account_public_address &stakeholder_address,
|
||||
transaction& tx,
|
||||
uint64_t tx_version,
|
||||
const blobdata& extra_nonce /* = blobdata() */,
|
||||
size_t max_outs /* = CURRENCY_MINER_TX_MAX_OUTS */,
|
||||
bool pos /* = false */,
|
||||
const pos_entry& pe /* = pos_entry() */,
|
||||
crypto::scalar_t& blinding_masks_sum /* = crypto::scalar_t() */
|
||||
const blobdata& extra_nonce /* = blobdata() */,
|
||||
size_t max_outs /* = CURRENCY_MINER_TX_MAX_OUTS */,
|
||||
bool pos /* = false */,
|
||||
const pos_entry& pe /* = pos_entry() */,
|
||||
crypto::scalar_t* blinding_masks_sum_ptr /* = nullptr */
|
||||
)
|
||||
{
|
||||
bool r = false;
|
||||
|
|
@ -297,7 +297,7 @@ namespace currency
|
|||
// fill outputs
|
||||
crypto::scalar_vec_t blinding_masks(destinations.size()); // vector of secret blinging masks for each output. For range proof generation
|
||||
crypto::scalar_vec_t amounts(destinations.size()); // vector of amounts, converted to scalars. For ranage proof generation
|
||||
blinding_masks_sum = 0;
|
||||
crypto::scalar_t blinding_masks_sum = 0;
|
||||
uint64_t output_index = 0;
|
||||
for (auto& d : destinations)
|
||||
{
|
||||
|
|
@ -335,6 +335,9 @@ namespace currency
|
|||
set_tx_unlock_time(tx, height + CURRENCY_MINED_MONEY_UNLOCK_WINDOW);
|
||||
}
|
||||
|
||||
if (blinding_masks_sum_ptr)
|
||||
*blinding_masks_sum_ptr = blinding_masks_sum;
|
||||
|
||||
return true;
|
||||
}
|
||||
//------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ namespace currency
|
|||
size_t max_outs = CURRENCY_MINER_TX_MAX_OUTS,
|
||||
bool pos = false,
|
||||
const pos_entry& pe = pos_entry(),
|
||||
crypto::scalar_t& blinding_masks_sum = crypto::scalar_t());
|
||||
crypto::scalar_t* blinding_masks_sum_ptr = nullptr);
|
||||
//---------------------------------------------------------------
|
||||
uint64_t get_string_uint64_hash(const std::string& str);
|
||||
bool construct_tx_out(const tx_destination_entry& de, const crypto::secret_key& tx_sec_key, size_t output_index, transaction& tx, std::set<uint16_t>& deriv_cache, const account_keys& self, crypto::scalar_t& out_blinding_mask, finalized_tx& result, uint8_t tx_outs_attr = CURRENCY_TO_KEY_OUT_RELAXED);
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ bool test_generator::construct_block(currency::block& blk,
|
|||
test_generator::get_test_gentime_settings().miner_tx_max_outs,
|
||||
static_cast<bool>(coin_stake_sources.size()),
|
||||
pe,
|
||||
blinding_masks_sum);
|
||||
&blinding_masks_sum);
|
||||
CHECK_AND_ASSERT_MES(r, false, "construct_miner_tx failed");
|
||||
|
||||
size_t coinbase_size = get_object_blobsize(blk.miner_tx);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue