Output table and known_outputs_t modified

fix_nonunique_outputs
moneroexamples 5 years ago
parent bfc2498dde
commit 174b934501

@ -91,7 +91,7 @@ CREATE TABLE IF NOT EXISTS `Outputs` (
`mixin` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `out_pub_key` (`out_pub_key`),
UNIQUE KEY `out_pub_key` (`out_pub_key`, `tx_id`),
KEY `tx_id` (`tx_id`),
KEY `account_id` (`account_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

@ -190,7 +190,7 @@ CREATE TABLE IF NOT EXISTS `Outputs` (
`mixin` bigint(20) UNSIGNED NOT NULL DEFAULT '0',
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `out_pub_key` (`out_pub_key`),
UNIQUE KEY `out_pub_key` (`out_pub_key`, `tx_id`),
KEY `tx_id` (`tx_id`),
KEY `account_id` (`account_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=140460833003782 DEFAULT CHARSET=utf8;

@ -872,7 +872,7 @@ CurrentBlockchainStatus::get_searched_blk_no(const string& address,
bool
CurrentBlockchainStatus::get_known_outputs_keys(
string const& address,
unordered_map<public_key, uint64_t>& known_outputs_keys)
known_outputs_t& known_outputs_keys)
{
std::lock_guard<std::mutex> lck (searching_threads_map_mtx);

@ -50,6 +50,8 @@ public:
// recieved_time, tx
using mempool_txs_t = vector<pair<uint64_t, transaction>>;
//output_pubk, amount
using known_outputs_t = unordered_multimap<public_key, uint64_t>;
// height , timestamp, is_coinbase
using txs_tuple_t
@ -259,8 +261,7 @@ public:
virtual bool
get_known_outputs_keys(string const& address,
unordered_map<public_key,
uint64_t>& known_outputs_keys);
known_outputs_t& known_outputs_keys);
virtual void
clean_search_thread_map();

@ -1452,6 +1452,9 @@ OpenMoneroRequests::import_recent_wallet_request(
XmrAccount updated_acc = acc;
//cout << updated_acc.scanned_block_height
//<< ',' << no_blocks_to_import << '\n';
// make sure scanned_block_height is larger than
// no_blocks_to_import so we dont
// end up with overflowing uint64_t.
@ -1805,7 +1808,7 @@ OpenMoneroRequests::get_tx(
// we have to redo this info from basically from scrach.
unordered_map<public_key, uint64_t> known_outputs_keys;
CurrentBlockchainStatus::known_outputs_t known_outputs_keys;
if (current_bc_status->get_known_outputs_keys(
xmr_address, known_outputs_keys))

@ -721,7 +721,7 @@ TxSearch::populate_known_outputs()
hex_to_pod(out.out_pub_key, out_pub_key);
known_outputs_keys[out_pub_key] = out.amount;
known_outputs_keys.insert({out_pub_key, out.amount});
}
}
}

@ -30,7 +30,7 @@ class TxSearch
public:
// out_pk , amount
using known_outputs_t = std::unordered_map<public_key, uint64_t>;
using known_outputs_t = std::unordered_multimap<public_key, uint64_t>;
using addr_view_t = std::pair<address_parse_info, secret_key>;
using pool_txs_t = std::vector<pair<uint64_t, transaction>>;

@ -1 +1 @@
Subproject commit 4356c9892b9903da4410f773ea36a6e4c799be5a
Subproject commit b1ac5139d49f190069912d2771be17011f67926e
Loading…
Cancel
Save