Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个设计没有考虑到分支的情况 #1

Open
Gxz-NGU opened this issue Jun 7, 2018 · 0 comments
Open

这个设计没有考虑到分支的情况 #1

Gxz-NGU opened this issue Jun 7, 2018 · 0 comments

Comments

@Gxz-NGU
Copy link

Gxz-NGU commented Jun 7, 2018

Block block1 = new Block(genesis.hash); addBlock(block1); Block block0 = new Block(block1.hash); addBlock(block0); Block block2 = new Block(block1.hash); addBlock(block2); Block block3 = new Block(block2.hash); isChainValid();
第一个问题:验证有效性的时候,是不是应该在每个区块建立后就进行验证呢?
第二个问题:当前BlockChain是以ArrayList[Block]的形式,当检验的时候,如上设置了分支的形式就会报错,是不是这个设计不太对,与当前的比特币的设计思路不一样,是不是应该将List换为tree呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant