diff options
| author | Riccardo Spagni <ric@spagni.net> | 2016-08-11 22:43:14 +0200 |
|---|---|---|
| committer | Riccardo Spagni <ric@spagni.net> | 2016-08-11 22:43:14 +0200 |
| commit | 0faf572db890c8bed9e5e4a7a21cd7d46d6f53d2 (patch) | |
| tree | db8b1e95cb6f53c452cd8a06fcf19439a7ec6a36 /src/cryptonote_core/blockchain.cpp | |
| parent | cb17c4da4f07a5052a62b96a80e27867955fc8bb (diff) | |
| parent | 11dc091464a6cef41434a0bb9f8604f6151c8dc5 (diff) | |
| download | monzero-core-0faf572db890c8bed9e5e4a7a21cd7d46d6f53d2.tar.gz monzero-core-0faf572db890c8bed9e5e4a7a21cd7d46d6f53d2.tar.xz monzero-core-0faf572db890c8bed9e5e4a7a21cd7d46d6f53d2.zip | |
Merge pull request #948
11dc091 Fake outs set is now decided by the wallet (moneromooo-monero)
1593553 new unlocked parameter to output_histogram (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
| -rw-r--r-- | src/cryptonote_core/blockchain.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index d332f8997..cc6b48b6b 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1597,6 +1597,25 @@ bool Blockchain::get_random_outs_for_amounts(const COMMAND_RPC_GET_RANDOM_OUTPUT return true; } //------------------------------------------------------------------ +bool Blockchain::get_outs(const COMMAND_RPC_GET_OUTPUTS::request& req, COMMAND_RPC_GET_OUTPUTS::response& res) const +{ + LOG_PRINT_L3("Blockchain::" << __func__); + CRITICAL_REGION_LOCAL(m_blockchain_lock); + + res.outs.clear(); + res.outs.reserve(req.outputs.size()); + for (const auto &i: req.outputs) + { + // get tx_hash, tx_out_index from DB + crypto::public_key key = m_db->get_output_key(i.amount, i.index).pubkey; + tx_out_index toi = m_db->get_output_tx_and_index(i.amount, i.index); + bool unlocked = is_tx_spendtime_unlocked(m_db->get_tx_unlock_time(toi.first)); + + res.outs.push_back({key, unlocked}); + } + return true; +} +//------------------------------------------------------------------ // This function takes a list of block hashes from another node // on the network to find where the split point is between us and them. // This is used to see what to send another node that needs to sync. @@ -3316,9 +3335,9 @@ bool Blockchain::get_hard_fork_voting_info(uint8_t version, uint32_t &window, ui return m_hardfork->get_voting_info(version, window, votes, threshold, earliest_height, voting); } -std::map<uint64_t, uint64_t> Blockchain:: get_output_histogram(const std::vector<uint64_t> &amounts) const +std::map<uint64_t, uint64_t> Blockchain:: get_output_histogram(const std::vector<uint64_t> &amounts, bool unlocked) const { - return m_db->get_output_histogram(amounts); + return m_db->get_output_histogram(amounts, unlocked); } void Blockchain::load_compiled_in_block_hashes() |
