mirror of
https://github.com/monero-project/monero.git
synced 2025-05-02 17:14:51 -04:00
add rct to the protocol
It is not yet constrained to a fork, so don't use on the real network or you'll be orphaned or rejected.
This commit is contained in:
parent
211d1db762
commit
dc4aad7eb5
26 changed files with 1219 additions and 285 deletions
|
@ -39,7 +39,7 @@ namespace
|
|||
{
|
||||
struct tx_builder
|
||||
{
|
||||
void step1_init(size_t version = CURRENT_TRANSACTION_VERSION, uint64_t unlock_time = 0)
|
||||
void step1_init(size_t version = 1, uint64_t unlock_time = 0)
|
||||
{
|
||||
m_tx.vin.clear();
|
||||
m_tx.vout.clear();
|
||||
|
@ -108,9 +108,13 @@ namespace
|
|||
BOOST_FOREACH(const tx_source_entry& src_entr, sources)
|
||||
{
|
||||
std::vector<const crypto::public_key*> keys_ptrs;
|
||||
std::vector<crypto::public_key> keys(src_entr.outputs.size());
|
||||
size_t j = 0;
|
||||
BOOST_FOREACH(const tx_source_entry::output_entry& o, src_entr.outputs)
|
||||
{
|
||||
keys_ptrs.push_back(&o.second);
|
||||
keys[j] = rct::rct2pk(o.second.dest);
|
||||
keys_ptrs.push_back(&keys[j]);
|
||||
++j;
|
||||
}
|
||||
|
||||
m_tx.signatures.push_back(std::vector<crypto::signature>());
|
||||
|
@ -136,7 +140,7 @@ namespace
|
|||
fill_tx_sources_and_destinations(events, blk_head, from, to, amount, TESTS_DEFAULT_FEE, 0, sources, destinations);
|
||||
|
||||
tx_builder builder;
|
||||
builder.step1_init(CURRENT_TRANSACTION_VERSION, unlock_time);
|
||||
builder.step1_init(1, unlock_time);
|
||||
builder.step2_fill_inputs(from.get_keys(), sources);
|
||||
builder.step3_fill_outputs(destinations);
|
||||
builder.step4_calc_hash();
|
||||
|
@ -177,7 +181,7 @@ bool gen_tx_big_version::generate(std::vector<test_event_entry>& events) const
|
|||
fill_tx_sources_and_destinations(events, blk_0, miner_account, miner_account, MK_COINS(1), TESTS_DEFAULT_FEE, 0, sources, destinations);
|
||||
|
||||
tx_builder builder;
|
||||
builder.step1_init(CURRENT_TRANSACTION_VERSION + 1, 0);
|
||||
builder.step1_init(1 + 1, 0);
|
||||
builder.step2_fill_inputs(miner_account.get_keys(), sources);
|
||||
builder.step3_fill_outputs(destinations);
|
||||
builder.step4_calc_hash();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue