forked from lthn/blockchain
construct_miner_tx now can use externally generated one time tx key
This commit is contained in:
parent
831719381b
commit
f8558a020a
2 changed files with 9 additions and 4 deletions
|
|
@ -186,8 +186,9 @@ namespace currency
|
|||
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 */
|
||||
const pos_entry& pe /* = pos_entry() */, // only pe.stake_unlock_time and pe.stake_amount are used now, TODO: consider refactoring -- sowle
|
||||
crypto::scalar_t* blinding_masks_sum_ptr /* = nullptr */,
|
||||
const keypair* tx_one_time_key_to_use /* = nullptr */
|
||||
)
|
||||
{
|
||||
bool r = false;
|
||||
|
|
@ -250,7 +251,10 @@ namespace currency
|
|||
tx = AUTO_VAL_INIT_T(transaction);
|
||||
tx.version = tx_version;
|
||||
|
||||
keypair txkey = keypair::generate();
|
||||
keypair txkey_local{};
|
||||
if (!tx_one_time_key_to_use)
|
||||
txkey_local = keypair::generate();
|
||||
const keypair& txkey = tx_one_time_key_to_use ? *tx_one_time_key_to_use : txkey_local;
|
||||
add_tx_pub_key_to_extra(tx, txkey.pub);
|
||||
if (extra_nonce.size())
|
||||
if (!add_tx_extra_userdata(tx, extra_nonce))
|
||||
|
|
|
|||
|
|
@ -244,7 +244,8 @@ 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_ptr = nullptr);
|
||||
crypto::scalar_t* blinding_masks_sum_ptr = nullptr,
|
||||
const keypair* tx_one_time_key_to_use = 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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue