Skip to content

Commit 2ff9aa9

Browse files
KleeTaurusliuchengxu
authored andcommitted
fix misspelling issue for hask(hash) (#13)
1 parent b3addd0 commit 2ff9aa9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

content/part-1/basic-prototype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func NewBlock(data string, prevBlockHash []byte) *Block {
112112

113113
有了区块,下面让我们来实现区块****。本质上,区块链就是一个有着特定结构的数据库,是一个有序,每一个块都连接到前一个块的链表。也就是说,区块按照插入的顺序进行存储,每个块都与前一个块相连。这样的结构,能够让我们快速地获取链上的最新块,并且高效地通过哈希来检索一个块。
114114

115-
在 Golang 中,可以通过一个 array 和 map 来实现这个结构:array 存储有序的哈希(Golang 中 array 是有序的),map 存储 **hask -> block** 对(Golang 中, map 是无序的)。 但是在基本的原型阶段,我们只用到了 array,因为现在还不需要通过哈希来获取块。
115+
在 Golang 中,可以通过一个 array 和 map 来实现这个结构:array 存储有序的哈希(Golang 中 array 是有序的),map 存储 **hash -> block** 对(Golang 中, map 是无序的)。 但是在基本的原型阶段,我们只用到了 array,因为现在还不需要通过哈希来获取块。
116116

117117
```go
118118
type Blockchain struct {

0 commit comments

Comments
 (0)