#pragma once #include #include #include // Forward Declarations class Database; class CoinDB { public: using UPtr = std::unique_ptr; CoinDB(mw::DBWrapper* pDBWrapper, mw::DBBatch* pBatch = nullptr); ~CoinDB(); // // Retrieve UTXOs with matching output IDs. // If there are multiple UTXOs for an output ID, the most recent will be returned. // std::unordered_map GetUTXOs( const std::vector& output_ids ) const; // // Add the UTXOs // void AddUTXOs(const std::vector& utxos); // // Removes the UTXOs for the given output IDs. // If there are multiple UTXOs for an output ID, the most recent will be removed. // DatabaseException thrown if no UTXOs are found for an output ID. // void RemoveUTXOs(const std::vector& output_ids); // // Removes all of the UTXOs from the database. // This is useful when resyncing the chain. // void RemoveAllUTXOs(); private: std::unique_ptr m_pDatabase; };