daleboy
6d6b66e33b
Update blockchain.go
...
Edit the function NewBlockchain:
1.delete the parameter of the function,the parameter is not used.
2.fix the description of the function,the description is not right.
2020-10-15 22:25:29 +08:00
Ivan Kuznetsov
bf64f33069
Merge pull request #6 from samguns/part_4
...
SetID method should use pointer receiver.
2018-03-01 20:37:14 +07:00
samguns
46e935c851
SetID method should use pointer receiver.
2017-10-31 17:21:50 +08:00
Ivan Kuznetsov
373a09b2bc
Add a link to the README
2017-09-05 21:38:03 +07:00
Ivan Kuznetsov
d107d924a8
Final fixes
2017-09-05 21:35:45 +07:00
Ivan Kuznetsov
e89846d490
Rework UTXO related functions
2017-09-05 14:33:33 +07:00
Ivan Kuznetsov
f4ae5168b0
Minor improvements
2017-09-05 12:26:29 +07:00
Ivan Kuznetsov
c748768da2
genesisCoinbase → genesisCoinbaseData
2017-09-05 11:34:47 +07:00
Ivan Kuznetsov
7904009c2f
Set PoW target to 24
2017-09-04 11:32:59 +07:00
Ivan Kuznetsov
32dd771eef
Rename Transaction.GetHash to SetID; add Transaction.ID field
2017-09-04 11:32:24 +07:00
Ivan Kuznetsov
326ecb828c
Rename TXInput.LockedBy and TXOutput.Unlock methods
2017-09-04 11:26:30 +07:00
Ivan Kuznetsov
78dbfc69b6
Minor improvements
2017-09-04 11:02:24 +07:00
Ivan Kuznetsov
6388b20f32
Fix unspent transactions finding
2017-09-03 11:35:36 +07:00
Ivan Kuznetsov
751d791399
Implement 'createblockchain' command
2017-09-03 11:17:10 +07:00
Ivan Kuznetsov
87eb17bbe5
Implement 'getbalance' command
2017-09-03 11:02:46 +07:00
Ivan Kuznetsov
f83ccd7b4c
Rework Blockchain.FindUTXOs
2017-09-03 11:01:02 +07:00
Ivan Kuznetsov
95d3f69363
Implement Blockchain.FindUTXOs
2017-09-03 10:41:45 +07:00
Ivan Kuznetsov
6941c5f32e
Replace 'addblock' command with 'spend'
2017-09-03 10:05:18 +07:00
Ivan Kuznetsov
8e6636983a
Fix printChain
2017-09-03 09:57:32 +07:00
Ivan Kuznetsov
46a1654c5a
Fix blocks adding to the blockchain
2017-09-03 09:56:43 +07:00
Ivan Kuznetsov
206f87e265
Improve block transactions hashing
2017-09-03 09:56:14 +07:00
Ivan Kuznetsov
08a211be41
Integrate transactions into the blockchain
2017-09-03 09:45:49 +07:00
Ivan Kuznetsov
2ba0f1bfdd
Implement transactions
2017-09-03 09:20:47 +07:00
Ivan Kuznetsov
d3b2c5c576
Update README
2017-08-29 16:29:19 +07:00
Ivan Kuznetsov
54b6c07b6c
Add an information print when there's no blockchain
2017-08-29 16:27:33 +07:00
Ivan Kuznetsov
5b46248ff2
Rework the CLI using 'flag'
2017-08-29 12:09:47 +07:00
Ivan Kuznetsov
b0791af5c6
Improve command line arguments processing
2017-08-28 21:03:43 +07:00
Ivan Kuznetsov
52477175c1
Implement basic CLI
2017-08-28 16:48:53 +07:00
Ivan Kuznetsov
d99bbc1b63
Add .gitignore
2017-08-28 16:28:59 +07:00
Ivan Kuznetsov
a93e1e96c9
Store a DB connection in Blockchain
2017-08-28 16:28:23 +07:00
Ivan Kuznetsov
e6cf54a124
Refactor NewBlockchain
2017-08-28 16:16:45 +07:00
Ivan Kuznetsov
fdccadfb63
Implement DB persistence
2017-08-28 13:57:27 +07:00
Ivan Kuznetsov
85022254ec
Implement serialization and deserialization of a block
2017-08-28 12:11:51 +07:00
Ivan Kuznetsov
56cb2de106
Add README
2017-08-27 08:17:57 +07:00
Ivan Kuznetsov
fec88e3443
Remove a comment
2017-08-24 12:20:43 +07:00
Ivan Kuznetsov
2a9385dd5b
Rename ConfirmProof function to Validate
2017-08-24 10:35:14 +07:00
Ivan Kuznetsov
d379fdeae2
Simplify 'target'
2017-08-22 17:26:12 +07:00
Ivan Kuznetsov
f94bbb4451
Improve ConfirmProof and print it out in main()
2017-08-22 11:41:15 +07:00
Ivan Kuznetsov
35449eb8a6
Clean up and refactor proofofwork.go
2017-08-21 21:06:52 +07:00
Ivan Kuznetsov
94f3654c8b
Output mining progress
2017-08-21 20:51:17 +07:00
Ivan Kuznetsov
0f23d64aa0
Implement Proof-of-Work
2017-08-21 17:50:41 +07:00
Ivan Kuznetsov
cc4a2d8b43
Fix it!
2017-08-17 13:06:42 +07:00
Ivan Kuznetsov
9104fae035
Rename PrevBlock to PrevBlockHash for clarity
2017-08-17 13:04:56 +07:00
Ivan Kuznetsov
6fbf7ac6b4
Make the output more verbose
2017-08-16 14:20:18 +07:00
Ivan Kuznetsov
8a720666c7
Use empty PrevBlock in the genesis block
2017-08-16 14:12:44 +07:00
Ivan Kuznetsov
469281645c
Use NewBlock in Blockchain.AddBlock
2017-08-16 13:55:18 +07:00
Ivan Kuznetsov
6a8b988a61
Fix empty byte array initialization
2017-08-16 13:10:41 +07:00
Ivan Kuznetsov
cb8f5303dd
Remove a debug print
2017-08-16 13:08:07 +07:00
Ivan Kuznetsov
18fe4a94c9
Refactor Block.SetHash
2017-08-16 13:07:30 +07:00
Ivan Kuznetsov
8767cb3528
Improve output
2017-08-16 12:33:54 +07:00