2021-07-19 20:42:38 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cryptonote_basic/cryptonote_basic.h>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
#include "keyring.hpp"
|
|
|
|
#include "output.hpp"
|
|
|
|
|
|
|
|
namespace db {
|
|
|
|
class Database;
|
2021-07-19 20:42:38 +02:00
|
|
|
}
|
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
namespace wallet {
|
|
|
|
struct BlockTX;
|
2021-07-19 20:42:38 +02:00
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
class TransactionScanner {
|
|
|
|
public:
|
|
|
|
TransactionScanner(std::shared_ptr<Keyring> keys, std::shared_ptr<db::Database> db) :
|
|
|
|
wallet_keys(keys), db(db) {}
|
2021-07-19 20:42:38 +02:00
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
std::vector<Output> scan_received(const BlockTX& tx, int64_t height, int64_t timestamp);
|
2021-07-19 20:42:38 +02:00
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
std::vector<crypto::key_image> scan_spent(const cryptonote::transaction& tx);
|
2021-07-19 20:42:38 +02:00
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
void set_keys(std::shared_ptr<Keyring> keys);
|
2023-03-14 23:11:27 +01:00
|
|
|
|
2023-04-13 15:50:13 +02:00
|
|
|
private:
|
2021-07-19 20:42:38 +02:00
|
|
|
std::shared_ptr<Keyring> wallet_keys;
|
|
|
|
std::shared_ptr<db::Database> db;
|
2023-04-13 15:50:13 +02:00
|
|
|
};
|
2021-07-19 20:42:38 +02:00
|
|
|
|
|
|
|
} // namespace wallet
|