wallet: adds rescan_bc option with preserving key images
- enables to perform rescan_spent / ki sync with untrusted daemon. Spent check status involves RPC calls which require trusted daemon status as it leaks information. The new call performs soft reset while preserving key images thus a sequence: refresh, ki sync / import, rescan_bc keep_ki will correctly perform spent checking without need for trusted daemon. - useful to detect spent outputs with untrusted daemon on watch_only / multisig / hw-cold wallets after expensive key image sync. - cli: rescan_bc keep_ki
This commit is contained in:
@@ -818,7 +818,7 @@ namespace tools
|
||||
|
||||
uint64_t get_blockchain_current_height() const { return m_light_wallet_blockchain_height ? m_light_wallet_blockchain_height : m_blockchain.size(); }
|
||||
void rescan_spent();
|
||||
void rescan_blockchain(bool hard, bool refresh = true);
|
||||
void rescan_blockchain(bool hard, bool refresh = true, bool keep_key_images = false);
|
||||
bool is_transfer_unlocked(const transfer_details& td) const;
|
||||
bool is_transfer_unlocked(uint64_t unlock_time, uint64_t block_height) const;
|
||||
|
||||
@@ -1248,6 +1248,9 @@ namespace tools
|
||||
void set_tx_notify(const std::shared_ptr<tools::Notify> ¬ify) { m_tx_notify = notify; }
|
||||
|
||||
bool is_tx_spendtime_unlocked(uint64_t unlock_time, uint64_t block_height) const;
|
||||
void hash_m_transfer(const transfer_details & transfer, crypto::hash &hash) const;
|
||||
uint64_t hash_m_transfers(int64_t transfer_height, crypto::hash &hash) const;
|
||||
void finish_rescan_bc_keep_key_images(uint64_t transfer_height, const crypto::hash &hash);
|
||||
|
||||
private:
|
||||
/*!
|
||||
@@ -1269,6 +1272,7 @@ namespace tools
|
||||
void detach_blockchain(uint64_t height);
|
||||
void get_short_chain_history(std::list<crypto::hash>& ids, uint64_t granularity = 1) const;
|
||||
bool clear();
|
||||
void clear_soft(bool keep_key_images=false);
|
||||
void pull_blocks(uint64_t start_height, uint64_t& blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<cryptonote::block_complete_entry> &blocks, std::vector<cryptonote::COMMAND_RPC_GET_BLOCKS_FAST::block_output_indices> &o_indices);
|
||||
void pull_hashes(uint64_t start_height, uint64_t& blocks_start_height, const std::list<crypto::hash> &short_chain_history, std::vector<crypto::hash> &hashes);
|
||||
void fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height, std::list<crypto::hash> &short_chain_history, bool force = false);
|
||||
|
||||
Reference in New Issue
Block a user