Wei Yang
5e43c770ee
merkle tree: fix the implementation and add a test case
...
Merkle tree requires a full binary tree, which means the number of node is
power of 2 and the level of the tree is log(N) instead of N/2.
This patch duplicate the node to a power of 2 number and correct the level
calculation. Besides it adds a test case with 6 nodes.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2017-10-16 12:45:37 +08:00
Wei Yang
c0accf31e0
cli: show timestamp of the block
2017-10-12 08:58:28 +08:00
Ivan Kuznetsov
cb32e7ca13
Fix ranging in Base58Encode and Base58Decode
2017-10-06 17:42:49 +07:00
Ivan Kuznetsov
58f9eb7dc5
Update README
2017-10-06 17:32:52 +07:00
Ivan Kuznetsov
a96a5bc1e6
Fix the main scenario
2017-10-06 12:29:55 +07:00
Ivan Kuznetsov
64d1cc5569
When a new block is mined, let everyone know
2017-10-06 11:30:51 +07:00
Ivan Kuznetsov
5c4340f47d
Add -miner flag to 'startnode' command
2017-10-03 16:21:15 +07:00
Ivan Kuznetsov
13f22d2e40
Update UTXOSet after adding a new block
2017-10-03 15:54:50 +07:00
Ivan Kuznetsov
150778f920
Add -mine option to the 'send' command
2017-10-03 15:54:31 +07:00
Ivan Kuznetsov
9de40a9385
Fix 'version' message exhanging
2017-10-03 15:47:56 +07:00
Ivan Kuznetsov
3cb93b5278
Implement 'tx' command (WIP)
2017-10-03 15:47:27 +07:00
Ivan Kuznetsov
c753df287a
Implement the correct way of synchronizing a blockchain
2017-10-01 21:33:03 +07:00
Ivan Kuznetsov
a79d78ad8c
Implement Blockchain.AddBlock
2017-10-01 20:30:21 +07:00
Ivan Kuznetsov
470adef2c3
Implement 'block' and 'getdata' commands
2017-10-01 11:50:27 +07:00
Ivan Kuznetsov
9adb5fc139
Implement 'getblocks' command
2017-10-01 11:19:43 +07:00
Ivan Kuznetsov
0c59d8cd52
Show block height in 'printchain' command
2017-10-01 11:04:31 +07:00
Ivan Kuznetsov
2734285450
Implement block height
2017-10-01 11:02:38 +07:00
Ivan Kuznetsov
130cf66a90
Fix wallet file name
2017-10-01 10:53:26 +07:00
Ivan Kuznetsov
4acc3ae271
Update .gitignore
2017-10-01 10:53:19 +07:00
Ivan Kuznetsov
0c91da0e52
Wallet file name must depend on node ID
2017-10-01 10:48:51 +07:00
Ivan Kuznetsov
57f3680551
Blockchain file name must depend on node ID
2017-10-01 10:42:34 +07:00
Ivan Kuznetsov
504b6c85bf
Set node ID via an env. var
2017-10-01 10:29:04 +07:00
Ivan Kuznetsov
4a9f7be98c
Implement 'addr' command
2017-10-01 10:25:11 +07:00
Ivan Kuznetsov
7935589f8a
Send 'vrack' in response to 'version'
2017-10-01 10:08:51 +07:00
Ivan Kuznetsov
1c5bc460f4
Implement 'version' command
2017-10-01 09:33:33 +07:00
Ivan Kuznetsov
60a1386f3d
Implement 'startnode' CLI command
2017-10-01 08:44:41 +07:00
Ivan Kuznetsov
2e06c0a637
Update the README
2017-09-19 16:44:23 +07:00
Ivan Kuznetsov
9b9b571028
Fill coinbase transaction data with random bytes
2017-09-19 15:47:03 +07:00
Ivan Kuznetsov
ffac3de519
Lower the difficulty of PoW
2017-09-19 15:03:30 +07:00
Ivan Kuznetsov
74cbac4e8f
Revert "Fix the 'checksum' function"
...
This reverts commit 465b85d5f2
.
2017-09-19 14:53:53 +07:00
Ivan Kuznetsov
8cafc0ef1e
Use Merkle root hash in proof-of-work
2017-09-18 13:01:43 +07:00
Ivan Kuznetsov
668d209f5e
Implement Merkle tree
2017-09-18 12:45:58 +07:00
Ivan Kuznetsov
827f124c61
Refactor something in UTXOSet
2017-09-18 11:01:24 +07:00
Ivan Kuznetsov
337a637825
Rename UTXOSet.GetCount to UTXOSet.CountTransactions
2017-09-18 10:41:36 +07:00
Ivan Kuznetsov
8ef0f2c86b
Add a newline
2017-09-17 12:45:53 +07:00
Ivan Kuznetsov
47737a28af
FindAllUTXO → FindUTXO
2017-09-17 12:44:43 +07:00
Ivan Kuznetsov
4f0e04fde7
Reindex the UTXO set after creating a new blockchain
2017-09-17 12:37:45 +07:00
Ivan Kuznetsov
99d1134beb
Update the UTXO set after mining a new block
2017-09-17 12:21:24 +07:00
Ivan Kuznetsov
fe34c88dfc
Implement UTXOSet.Update
2017-09-17 12:19:01 +07:00
Ivan Kuznetsov
3e491be4d7
Use the UTXO set to send coins
2017-09-17 11:49:59 +07:00
Ivan Kuznetsov
0b7d2ac63f
Remove Blockchain.FindUTXO
2017-09-17 11:33:58 +07:00
Ivan Kuznetsov
e3739acac9
Use the UTXO set to get balance
2017-09-17 11:01:29 +07:00
Ivan Kuznetsov
c3aa678291
Implment UTXOSet.FindUTXO
2017-09-17 11:01:18 +07:00
Ivan Kuznetsov
b15e1117f9
Implement DeserializeOutputs
2017-09-17 11:01:06 +07:00
Ivan Kuznetsov
cb78220abb
Remove the 'address' argument from NewBlockchain, since it's not used anymore
2017-09-17 10:43:23 +07:00
Ivan Kuznetsov
7eda539141
Improve UTXOSet
2017-09-17 10:30:30 +07:00
Ivan Kuznetsov
249b7f4eff
Implement UTXOSet
2017-09-17 10:16:14 +07:00
Ivan Kuznetsov
2f54328190
Implement TXOutputs
2017-09-17 10:15:58 +07:00
Ivan Kuznetsov
01b9dd2eab
Implement Blockchain.FindAllUTXO
2017-09-17 10:04:28 +07:00
Ivan Kuznetsov
56ccd7c8ca
Implement rewards
2017-09-17 09:16:50 +07:00