danicoin/src/Transfers/TransfersSubscription.h

38 lines
1.3 KiB
C
Raw Normal View History

// Copyright (c) 2011-2016 The Cryptonote developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#pragma once
#include "ITransfersSynchronizer.h"
#include "TransfersContainer.h"
#include "IObservableImpl.h"
namespace CryptoNote {
class TransfersSubscription : public IObservableImpl < ITransfersObserver, ITransfersSubscription > {
public:
2015-05-27 12:08:46 +00:00
TransfersSubscription(const CryptoNote::Currency& currency, const AccountSubscription& sub);
SynchronizationStart getSyncStart();
2015-07-30 15:22:07 +00:00
void onBlockchainDetach(uint32_t height);
void onError(const std::error_code& ec, uint32_t height);
bool advanceHeight(uint32_t height);
const AccountKeys& getKeys() const;
2015-12-09 13:19:03 +00:00
bool addTransaction(const TransactionBlockInfo& blockInfo, const ITransactionReader& tx,
2015-07-15 12:23:00 +00:00
const std::vector<TransactionOutputInformationIn>& transfers);
2015-07-30 15:22:07 +00:00
void deleteUnconfirmedTransaction(const Crypto::Hash& transactionHash);
2015-08-11 14:33:19 +00:00
void markTransactionConfirmed(const TransactionBlockInfo& block, const Crypto::Hash& transactionHash, const std::vector<uint32_t>& globalIndices);
// ITransfersSubscription
2015-07-30 15:22:07 +00:00
virtual AccountPublicAddress getAddress() override;
virtual ITransfersContainer& getContainer() override;
private:
2015-07-30 15:22:07 +00:00
TransfersContainer transfers;
AccountSubscription subscription;
};
}