forked from cryptonotefoundation/cryptonote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathITransactionValidator.h
39 lines (29 loc) · 1005 Bytes
/
ITransactionValidator.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2011-2015 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 "CryptoNoteCore/CryptoNoteBasic.h"
namespace CryptoNote {
struct BlockInfo {
uint32_t height;
Crypto::Hash id;
BlockInfo() {
clear();
}
void clear() {
height = 0;
id = CryptoNote::NULL_HASH;
}
bool empty() const {
return id == CryptoNote::NULL_HASH;
}
};
class ITransactionValidator {
public:
virtual ~ITransactionValidator() {}
virtual bool checkTransactionInputs(const CryptoNote::Transaction& tx, BlockInfo& maxUsedBlock) = 0;
virtual bool checkTransactionInputs(const CryptoNote::Transaction& tx, BlockInfo& maxUsedBlock, BlockInfo& lastFailed) = 0;
virtual bool haveSpentKeyImages(const CryptoNote::Transaction& tx) = 0;
virtual bool checkTransactionSize(size_t blobSize) = 0;
};
}