Neil Booth
06c8eda161
Preparations for peer discovery
...
DEFAULT_PORTS is a now a coin property.
Other miscellaneous updates to get things closer
2017-01-29 06:47:43 +09:00
Neil Booth
131601a7b2
Rework clean shutdown logic
...
So that the main block processor future is cancellable.
We wait for the executor and then flush anything unflushed.
Resolves the rest of the second part of #100
2017-01-16 21:22:24 +09:00
Neil Booth
5784412393
Write out undo info with the UTXO flushes
...
Cleaner and slightly more efficient.
Closes #101
2017-01-09 18:58:39 +09:00
Neil Booth
4d62019b07
Check Genesis hash
...
Testnet RPC_PORT is 18332
2017-01-08 10:07:57 +09:00
Neil Booth
852753cb94
Implement deserialization of SegWit transactions
...
tx_hash needs to be that of the prior serialization, so
need to change internal read_block API.
Bitcoin core 0.13.1 broke backwards compat of the RPC interface.
Closes #92
2017-01-08 10:07:57 +09:00
Neil Booth
91ca5fc14a
Split out history into its own DB.
2017-01-07 11:51:12 +09:00
Neil Booth
7f9cb9cd9d
Generic header length
...
If header lengths change in the future, only one function needs
to change in coins.py.
2017-01-07 11:51:12 +09:00
Neil Booth
c8c4199503
New VirtualFile abstraction
...
Use for headers, tx counts and tx hashes.
2017-01-07 11:51:11 +09:00
Neil Booth
427183ae01
Place metadata files in meta/, db in db/
2017-01-07 11:51:11 +09:00
Neil Booth
2b2909f1c4
Move to hashX
...
The hashX of a script is the first 11 bytes of its sha256 hash.
Closes #72 .
2017-01-07 11:51:01 +09:00
Neil Booth
533c97a575
Clean up DB open handling
...
Closes #89
2017-01-02 18:11:17 +09:00
Neil Booth
b8fc739590
Fix ordering in get_utxos
2016-11-27 21:54:05 +09:00
Neil Booth
6aef79461f
Don't shut down block processor by cancellation
...
The block processor needs to be able to close cleanly, and not
mid-block. In order to be able to yield whilst processing blocks
we cannot forcefully close its coroutine with a cancellation.
2016-11-27 12:20:16 +09:00
Neil Booth
1b95bcd8ac
Open DB differently depending on if syncing
...
If syncing, use a high max_open_files, otherwise lower it.
2016-11-27 07:25:28 +09:00
Neil Booth
95a2de6dae
Move DB undo code to db.py
2016-11-26 13:18:10 +09:00
Neil Booth
8d253c81d3
Move clean_db() to db.py
2016-11-26 13:15:45 +09:00
Neil Booth
59244cc24e
Move bulk of FS flush code to db.py
...
More logically belongs there.
Have servers use the flushed DB height not the block processor's height.
Get all headers only from disk.
2016-11-26 13:11:59 +09:00
Neil Booth
59733e4609
Move bitcoin-specific coin defaults to Bitcoin
2016-11-26 08:32:30 +09:00
TheLazieR Yip
e987510432
Replace double_sha256 with header_hash from coin
2016-11-25 07:25:57 -05:00
Neil Booth
aa9f106865
Add missing self; use max_secs where intended.
2016-11-20 23:11:35 +09:00
Neil Booth
8617c82ec2
Floor disk_count at zero.
2016-11-19 20:56:08 +09:00
Neil Booth
3d87e299ea
Move formatted_time to library
2016-11-19 15:42:06 +09:00
Neil Booth
ffd6cd63b0
Fix thinko
2016-11-19 08:16:20 +09:00
Neil Booth
d6fa4a1564
More logging improvements
...
- log software and DB version at startup
- log more DB info at startup
- log software and DB version when first synced
Fixes #29
2016-11-19 07:29:17 +09:00
Neil Booth
f4651c0ca4
Store tx_num in 'h' table key so keys are unique
2016-11-17 07:59:40 +09:00
Neil Booth
c5c7b6f438
Have all expensive requests yield.
2016-11-17 06:50:46 +09:00
Neil Booth
85786b87a2
Save all UTXOs
...
Change the DB version
2016-11-13 20:35:03 +09:00
Neil Booth
1b9a9b8927
Start saving DB version and checking it
2016-11-12 07:31:56 +09:00
Neil Booth
f98dc9c351
Practise optimism like before
2016-11-11 21:03:09 +09:00
Neil Booth
311f7f9ffd
Better optimised storage of UTXO set
2016-11-10 20:04:33 +09:00
Neil Booth
094fd44fc2
Merge UTXO cache into BlockProcessor
2016-11-10 07:49:01 +09:00
Neil Booth
06b6d695c2
Only attempt to flush if cancelled
2016-11-10 07:32:39 +09:00
Neil Booth
3972e18e98
Move the rest of fs_cache into BlockProcessor
2016-11-08 23:30:30 +09:00
Neil Booth
ad2dabf751
Remove the FS cache
...
Really belongs with BlockProcessor now
2016-11-08 20:06:06 +09:00
Neil Booth
5736e9cb70
Move utxo_cache to BlockProcessor where it belongs
2016-11-08 19:35:21 +09:00
Neil Booth
5c5e90d574
Move BlockServer to more appropriate location
2016-11-08 19:20:13 +09:00
Neil Booth
93d53bdd87
The controller is dead!
2016-11-08 08:29:56 +09:00
Neil Booth
c0a112f8ea
Split out part of block processor into db.py
...
The part that doesn't actually do any block processing...
2016-11-08 07:38:16 +09:00
Neil Booth
c008c04e43
Move caches to their own file.
...
Move the DB to the block_processor file. It will merge with it soon.
2016-10-27 07:58:00 +09:00
Neil Booth
30d1b7f77c
Add proper block chaining check
2016-10-27 07:38:39 +09:00
Neil Booth
78d0acc95b
Fix get_tx_hash
2016-10-27 07:33:21 +09:00
Neil Booth
28eb95edd3
Break out FS cache into its own class
2016-10-27 07:30:24 +09:00
Neil Booth
334ffdaa4f
Begin work on proper server
2016-10-17 20:02:42 +09:00
Neil Booth
c8f3c79167
Memory views for blocks don't seem to help
2016-10-16 09:08:38 +09:00
Neil Booth
19cbb2d00d
Fix ETA estimate
2016-10-15 12:43:23 +09:00
Neil Booth
282d46a46c
Flush to disk when flushing history
2016-10-15 11:41:55 +09:00
Neil Booth
34096a02e9
Recovery from excess history flushes
2016-10-15 08:42:42 +09:00
Neil Booth
cbe1ef60ca
Better logging
2016-10-14 20:26:10 +09:00
Neil Booth
5f77ff4ef0
Flush history separately.
...
We do not yet remove excess history.
2016-10-14 20:09:47 +09:00
Neil Booth
6b513a91d0
CACHE_MB is now the environment var.
2016-10-14 07:56:25 +09:00