-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBlock.h
More file actions
41 lines (31 loc) · 757 Bytes
/
Block.h
File metadata and controls
41 lines (31 loc) · 757 Bytes
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
40
41
//
// Block.h
// Created by Roshan Lamichhane on 12/7/19.
// Copyright © 2019 Roshan Lamichhane. All rights reserved.
//
#ifndef Block_h
#define Block_h
#include "TransactionData.h"
// Block Class
class Block{
private:
int index;
size_t blockHash;
size_t previousHash;
size_t generateHash();
public:
// Constuctor
Block(int idx, TransactionData d, size_t prevHash);
// Get Index
int getIndex();
// Get Original Hash
size_t getHash();
// Get Previous Hash
size_t getPreviousHash();
// Transaction Data
// Would ordinarily be a private member with a "getter": getData()
TransactionData data;
// Validate Hash
bool isHashValid();
};
#endif /* Block_h */