Commit Graph

34 Commits

Author SHA1 Message Date
Vivek Teega
3f628b70a5 Merging upstrem changes 2018-12-16 17:44:11 +05:30
SomberNight
73e2b09ba8
blockchain: check best chain on disk is consistent with checkpoints
had a corrupted mainnet datadir that had testnet blockchain_headers file
(I had probably corrupted it myself but electrum could not recover from it)
2018-11-30 16:36:37 +01:00
SomberNight
bddea809ec
storage/blockchain: use os.replace 2018-11-30 04:08:02 +01:00
ThomasV
d062548e41
Merge pull request #4861 from SomberNight/blockchain_fork_ids
blockchain: generalise fork handling and follow most work chain
2018-11-28 12:54:57 +01:00
SomberNight
d7c5949365
prefer int.from_bytes over int('0x'+hex, 16) 2018-11-26 01:16:26 +01:00
SomberNight
65ce3deeaa
blockchain: chain hierarchy based on most work, not length 2018-11-22 17:13:43 +01:00
SomberNight
141ff99580
blockchain.py: generalise fork ids to get rid of conflicts 2018-11-22 16:57:22 +01:00
SomberNight
a8e6eaa247
blockchain: fix difficulty retarget
"target" is a 256 bit int, but the "bits" field in the block headers
that is used to represent target is only 32 bits.
We were checking PoW against the untruncated target value, which is a
slightly larger value than the one that can actually be represented,
and hence we would have accepted a slightly lower difficulty chain
than what the consensus requires.
2018-11-22 16:52:51 +01:00
Vivek Teega
b3a21f53bc Chunk verification without saving headers locally 2018-11-08 21:07:26 +05:30
SomberNight
e37da62a1c
fix most "scripts"
related: #4754
2018-11-02 20:14:59 +01:00
SomberNight
082a83dd85
rename crypto.Hash to sha256d 2018-10-25 22:28:24 +02:00
SomberNight
81cc20039e
more type annotations in core lib 2018-10-22 16:41:25 +02:00
Vivek Teega
085cd9919e Target calculation & chunk verification
This commit adds the code for FLO chunk verification. FLO chunk verification is different from Bitcoin chunk verification as the blockchain has 3 different target recalculation times. ie. 90 blocks at height 0->208440, 15 blocks at height 208440->426000 & 1 block further down

Changes have also been maded such that chunk doesnt need to be saved in parts
2018-10-21 07:42:07 +05:30
SomberNight
37206ec08e
network: auto-switch servers to preferred fork (or longest chain)
If auto_connect is enabled, allow jumping between forks too.
(Previously auto_connect was only switching servers on a given fork,
not across forks)
If there is a preferred fork set, jump to that (and stay);
if there isn't, always jump to the longest fork.
2018-10-11 20:07:19 +02:00
Vivek Teega
6a2d2fbc3d Creating Morph branch
This is an attempt to commit the changes made to Electrum-BTC to morph it into FLO, on top of the latest Electrum-BTC codebase at the time of writing. The code has become messy pulling upstream changes and its become difficult to debug issues
2018-09-29 17:52:30 +05:30
Vivek Teega
4253dd27eb Fixing upstream merge conflicts 2018-09-23 22:02:05 +05:30
SomberNight
4360a785ad
blockchain: blockchains_lock needed to write/iterate global dict 2018-09-16 18:26:40 +02:00
SomberNight
1635bc8cb3
blockchain: use HEADER_SIZE named constant instead of magic numbers 2018-09-16 03:06:21 +02:00
Vivek Teega
f2e93e323a Fixing target calculation after changes from the upstream 2018-09-12 06:39:04 +05:30
SomberNight
8cd08cc0fa
network: rm dead code; simplify 2018-09-12 01:40:54 +02:00
Vivek Teega
9e0777a7b4 Solved upstream merge conflicts 2018-09-12 03:38:43 +05:30
SomberNight
a5b3f809ce
blockchain.py: add type annotations 2018-09-11 22:14:57 +02:00
SomberNight
cdca74aa39
move max_checkpoint from network to constants 2018-09-09 05:00:09 +02:00
SomberNight
3f0d79f07d
blockchain.py: better handling of missing headers. more restrictive verify_chunk. 2018-09-06 14:17:42 +02:00
Janus
e9ceeb85af
async block headers 2018-09-06 14:17:41 +02:00
Vivek Teega
1e6edd0abc Fixing exchanges and block explorer for FLO 2018-08-18 11:39:26 +05:30
Vivek Teega
c0daef2657 More changes to for save_chunk()
save_chunk() required more changes to save the block header chunks properly locally.
2018-08-14 15:10:19 +05:30
Vivek Teegalapally
a64228ba2c Small change to fix save_chunk_part() 2018-08-05 23:21:46 +05:30
Vivek Teegalapally
85bae50e62 Changes for target calculation
All the changes required for target calculation, verification and saving parts of chunks for FLO
@akhil2015

Co-authored-by: Akhil Bharti <akhil2015@users.noreply.github.com>
2018-08-05 23:18:30 +05:30
Bitspill
e0d33279de Commiting changes made by @bitspill
The following are the changes made by @bitspill to the original repo.
1. Changes to transaction.py to accomodate the txcomment/floData feature
2. Changes in server list
3. Renaming of BTC to FLO
The GUI and code changes required for exchange_rate.py file haven't been implemented. Its an independant module of the wallet, so will be changed later on
2018-08-05 16:10:36 +05:30
SomberNight
2a9f5db576
blockchain.py: fix: chunks in checkpoint region were not getting saved if we were on a fork 2018-08-03 19:06:23 +02:00
SomberNight
531cdeffa9
blockchain.py: rename 'checkpoint' to 'forkpoint' 2018-08-03 18:25:53 +02:00
SomberNight
b44aca1654
network: disconnect from server on incorrect header length
fix #4522
2018-07-13 18:11:48 +02:00
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00