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

A few fixes on Qt wallets, new icons + fixes on some files, see description pls #27

Merged
merged 33 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e634e3c
dos2unix
le2Ks Dec 1, 2020
d7d6c87
modified: configure.ac
le2Ks Dec 1, 2020
05f3b1f
modified: configure.ac
le2Ks Dec 1, 2020
07563a5
no need bench + test + fpic error with hardening + jump to 0.1.3
le2Ks Dec 1, 2020
a111756
fix on contrib/seeds + new seeds
le2Ks Dec 1, 2020
32f28f1
fix on /contrib/seeds invalid links + no required suspicious_hosts
le2Ks Dec 1, 2020
8f4b473
fix seeds + remove invalid dnsseeds + 1 sec instead of 1 minute to ig…
le2Ks Dec 1, 2020
a149163
fix on checkpoints for more safety + adding new checkpoint too
le2Ks Dec 1, 2020
c89bbd4
Update chainparams.cpp
le2Ks Dec 1, 2020
3e30297
chmod +x on depends
le2Ks Dec 1, 2020
4fda224
depends already compiled for winx64-x32
le2Ks Dec 2, 2020
6d5595f
new file: .gitignore
le2Ks Dec 2, 2020
e23c368
Missing icons part 1
le2Ks Dec 2, 2020
9db537f
Missing icons part 2
le2Ks Dec 2, 2020
d4261e0
fix fallbackfee error
le2Ks Dec 2, 2020
7d39eab
new time icons
le2Ks Dec 2, 2020
b7a19d3
Update transactiontablemodel.cpp
le2Ks Dec 2, 2020
970f93e
logo back to normal on main window for history transaction
le2Ks Dec 3, 2020
b88e703
jump to 0.1.4 after some changes
le2Ks Dec 3, 2020
37681db
lighter splashscreen
le2Ks Dec 3, 2020
592a703
Merge branch 'master' of https://github.com/Original-Tasty/bitgesell
le2Ks Dec 3, 2020
d006fa0
script for installing dependencies and preparing Linux server or VPS …
le2Ks Dec 3, 2020
d06d1c3
Update README.md
le2Ks Dec 3, 2020
b19683f
Rename depends.sh to depends
le2Ks Dec 3, 2020
e7402b6
Update and rename depends to depends.sh
le2Ks Dec 3, 2020
7949761
Update build-unix.md
le2Ks Dec 3, 2020
088974f
Update build-unix.md
le2Ks Dec 3, 2020
a09a245
Update build-unix.md
le2Ks Dec 3, 2020
ea304ef
Update build-unix.md
le2Ks Dec 3, 2020
0d55879
Update build-windows.md
le2Ks Dec 3, 2020
f1d8f2d
Update build-windows.md
le2Ks Dec 3, 2020
e8a5e78
Original dnsseeds
le2Ks Dec 8, 2020
32dd475
Removing depends script
le2Ks Dec 8, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BGL Core integration/staging tree
BGL Core integration/staging tree ![](share/pixmaps/BGL64.png)
=====================================

What is BGL?
Expand Down
486 changes: 243 additions & 243 deletions build_msvc/BGL.sln

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions configure.ac
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down Expand Up @@ -134,7 +134,7 @@ AC_ARG_ENABLE([upnp-default],
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
[use_tests=$enableval],
[use_tests=yes])
[use_tests=no])

AC_ARG_ENABLE(gui-tests,
AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]),
Expand All @@ -150,7 +150,7 @@ AC_ARG_WITH([rapidcheck],
AC_ARG_ENABLE(bench,
AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]),
[use_bench=$enableval],
[use_bench=yes])
[use_bench=no])

AC_ARG_ENABLE([extended-functional-tests],
AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]),
Expand All @@ -173,7 +173,7 @@ AC_ARG_ENABLE([hardening],
[AS_HELP_STRING([--disable-hardening],
[do not attempt to harden the resulting executables (default is to harden when possible)])],
[use_hardening=$enableval],
[use_hardening=auto])
[use_hardening=no])

AC_ARG_ENABLE([reduce-exports],
[AS_HELP_STRING([--enable-reduce-exports],
Expand Down
13 changes: 5 additions & 8 deletions contrib/seeds/README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Seeds
### Seeds ###

Utility to generate the seeds.txt list that is compiled into the client
(see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)).

Be sure to update `PATTERN_AGENT` in `makeseeds.py` to include the current version,
and remove old versions as necessary (at a minimum when GetDesirableServiceFlags
changes its default return value, as those are the services which seeds are added
to addrman with).

The seeds compiled into the release are created from sipa's DNS seed data, like this:

curl -s http://BGL.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt
python3 makeseeds.py < seeds_main.txt > nodes_main.txt
python3 generate-seeds.py . > ../../src/chainparamsseeds.h
python makeseeds.py < seeds_main.txt > nodes_main.txt
python generate-seeds.py . > ../../src/chainparamsseeds.h

## Dependencies

Ubuntu:

sudo apt-get install python3-dnspython


32 changes: 16 additions & 16 deletions contrib/seeds/generate-seeds.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
#!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Expand All @@ -11,7 +11,7 @@
nodes_main.txt
nodes_test.txt

These files must consist of lines in the format
These files must consist of lines in the format

<ip>
<ip>:<port>
Expand All @@ -31,11 +31,10 @@

These should be pasted into `src/chainparamsseeds.h`.
'''

from __future__ import print_function, division
from base64 import b32decode
from binascii import a2b_hex
import sys
import os
import sys, os
import re

# ipv4 in ipv6 prefix
Expand All @@ -47,7 +46,7 @@ def name_to_ipv6(addr):
if len(addr)>6 and addr.endswith('.onion'):
vchAddr = b32decode(addr[0:-6], True)
if len(vchAddr) != 16-len(pchOnionCat):
raise ValueError('Invalid onion %s' % vchAddr)
raise ValueError('Invalid onion %s' % s)
return pchOnionCat + vchAddr
elif '.' in addr: # IPv4
return pchIPv4 + bytearray((int(x) for x in addr.split('.')))
Expand All @@ -74,7 +73,7 @@ def name_to_ipv6(addr):
raise ValueError('Could not parse address %s' % addr)

def parse_spec(s, defaultport):
match = re.match(r'\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s)
match = re.match('\[([0-9a-fA-F:]+)\](?::([0-9]+))?$', s)
if match: # ipv6
host = match.group(1)
port = match.group(2)
Expand Down Expand Up @@ -115,24 +114,25 @@ def process_nodes(g, f, structname, defaultport):
def main():
if len(sys.argv)<2:
print(('Usage: %s <path_to_nodes_txt>' % sys.argv[0]), file=sys.stderr)
sys.exit(1)
exit(1)
g = sys.stdout
indir = sys.argv[1]
g.write('#ifndef BGL_CHAINPARAMSSEEDS_H\n')
g.write('#define BGL_CHAINPARAMSSEEDS_H\n')
g.write('/**\n')
g.write(' * List of fixed seed nodes for the BGL network\n')
g.write(' * List of fixed seed nodes for the falco network\n')
g.write(' * AUTOGENERATED by contrib/seeds/generate-seeds.py\n')
g.write(' *\n')
g.write(' * Each line contains a 16-byte IPv6 address and a port.\n')
g.write(' * IPv4 as well as onion addresses are wrapped inside an IPv6 address accordingly.\n')
g.write(' * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.\n')
g.write(' */\n')
with open(os.path.join(indir,'nodes_main.txt'), 'r', encoding="utf8") as f:
process_nodes(g, f, 'pnSeed6_main', 8333)
with open(os.path.join(indir,'nodes_main.txt'),'r') as f:
process_nodes(g, f, 'pnSeed6_main', 6060)
g.write('\n')
with open(os.path.join(indir,'nodes_test.txt'), 'r', encoding="utf8") as f:
process_nodes(g, f, 'pnSeed6_test', 18333)
with open(os.path.join(indir,'nodes_test.txt'),'r') as f:
process_nodes(g, f, 'pnSeed6_test', 16060)
g.write('#endif // BGL_CHAINPARAMSSEEDS_H\n')

if __name__ == '__main__':
main()

150 changes: 42 additions & 108 deletions contrib/seeds/makeseeds.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
#!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#

import re
import sys
import dns.resolver
import collections

NSEEDS=512

MAX_SEEDS_PER_ASN=2

MIN_BLOCKS = 337600
MIN_BLOCKS = 400000

# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
"130.211.129.106", "178.63.107.226",
"83.81.130.26", "88.198.17.7", "148.251.238.178", "176.9.46.6",
"54.173.72.127", "54.174.10.182", "54.183.64.54", "54.194.231.211",
"54.66.214.167", "54.66.220.137", "54.67.33.14", "54.77.251.214",
"54.94.195.96", "54.94.200.247"
}
SUSPICIOUS_HOSTS = set([
])

import re
import sys
# import dns.resolver
import collections

PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$")
PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$")
PATTERN_ONION = re.compile(r"^([abcdefghijklmnopqrstuvwxyz234567]{16}\.onion):(\d+)$")
PATTERN_AGENT = re.compile(
r"^/Satoshi:("
r"0.14.(0|1|2|3|99)|"
r"0.15.(0|1|2|99)|"
r"0.16.(0|1|2|3|99)|"
r"0.17.(0|0.1|1|2|99)|"
r"0.18.(0|1|99)|"
r"0.19.99"
r")")
PATTERN_AGENT = re.compile(r"^(\/Satoshi:0\.8\.6\/|\/Satoshi:0\.9\.(2|3|4|5)\/|\/Core:0.1(0|1|2).\d{1,2}.\d{1,2}\/)$")

def parseline(line):
sline = line.split()
Expand Down Expand Up @@ -107,124 +91,74 @@ def parseline(line):
'sortkey': sortkey,
}

def dedup(ips):
'''deduplicate by address,port'''
d = {}
for ip in ips:
d[ip['ip'],ip['port']] = ip
return list(d.values())

def filtermultiport(ips):
'''Filter out hosts with more nodes per IP'''
hist = collections.defaultdict(list)
for ip in ips:
hist[ip['sortkey']].append(ip)
return [value[0] for (key,value) in list(hist.items()) if len(value)==1]

def lookup_asn(net, ip):
'''
Look up the asn for an IP (4 or 6) address by querying cymru.com, or None
if it could not be found.
'''
try:
if net == 'ipv4':
ipaddr = ip
prefix = '.origin'
else: # http://www.team-cymru.com/IP-ASN-mapping.html
res = str() # 2001:4860:b002:23::68
for nb in ip.split(':')[:4]: # pick the first 4 nibbles
for c in nb.zfill(4): # right padded with '0'
res += c + '.' # 2001 4860 b002 0023
ipaddr = res.rstrip('.') # 2.0.0.1.4.8.6.0.b.0.0.2.0.0.2.3
prefix = '.origin6'

asn = int([x.to_text() for x in dns.resolver.query('.'.join(
reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com',
'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn
except Exception:
sys.stderr.write('ERR: Could not resolve ASN for "' + ip + '"\n')
return None
return [value[0] for (key,value) in hist.items() if len(value)==1]

# Based on Greg Maxwell's seed_filter.py
def filterbyasn(ips, max_per_asn, max_per_net):
def filterbyasn(ips, max_per_asn, max_total):
# Sift out ips by type
ips_ipv46 = [ip for ip in ips if ip['net'] in ['ipv4', 'ipv6']]
ips_ipv4 = [ip for ip in ips if ip['net'] == 'ipv4']
ips_ipv6 = [ip for ip in ips if ip['net'] == 'ipv6']
ips_onion = [ip for ip in ips if ip['net'] == 'onion']

# Filter IPv46 by ASN, and limit to max_per_net per network
# Filter IPv4 by ASN
result = []
net_count = collections.defaultdict(int)
asn_count = collections.defaultdict(int)
for ip in ips_ipv46:
if net_count[ip['net']] == max_per_net:
continue
asn = lookup_asn(ip['net'], ip['ip'])
if asn is None or asn_count[asn] == max_per_asn:
continue
asn_count[asn] += 1
net_count[ip['net']] += 1
result.append(ip)

# Add back Onions (up to max_per_net)
result.extend(ips_onion[0:max_per_net])
asn_count = {}
for ip in ips_ipv4:
if len(result) == max_total:
break
try:
asn = int([x.to_text() for x in dns.resolver.query('.'.join(reversed(ip['ip'].split('.'))) + '.origin.asn.cymru.com', 'TXT').response.answer][0].split('\"')[1].split(' ')[0])
if asn not in asn_count:
asn_count[asn] = 0
if asn_count[asn] == max_per_asn:
continue
asn_count[asn] += 1
result.append(ip)
except:
sys.stderr.write('ERR: Could not resolve ASN for "' + ip['ip'] + '"\n')

# TODO: filter IPv6 by ASN

# Add back non-IPv4
result.extend(ips_ipv6)
result.extend(ips_onion)
return result

def ip_stats(ips):
hist = collections.defaultdict(int)
for ip in ips:
if ip is not None:
hist[ip['net']] += 1

return '%6d %6d %6d' % (hist['ipv4'], hist['ipv6'], hist['onion'])

def main():
lines = sys.stdin.readlines()
ips = [parseline(line) for line in lines]

print('\x1b[7m IPv4 IPv6 Onion Pass \x1b[0m', file=sys.stderr)
print('%s Initial' % (ip_stats(ips)), file=sys.stderr)
# Skip entries with invalid address.
# Skip entries with valid address.
ips = [ip for ip in ips if ip is not None]
print('%s Skip entries with invalid address' % (ip_stats(ips)), file=sys.stderr)
# Skip duplicates (in case multiple seeds files were concatenated)
ips = dedup(ips)
print('%s After removing duplicates' % (ip_stats(ips)), file=sys.stderr)
# Skip entries from suspicious hosts.
ips = [ip for ip in ips if ip['ip'] not in SUSPICIOUS_HOSTS]
print('%s Skip entries from suspicious hosts' % (ip_stats(ips)), file=sys.stderr)
# Enforce minimal number of blocks.
ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS]
print('%s Enforce minimal number of blocks' % (ip_stats(ips)), file=sys.stderr)
# Require service bit 1.
ips = [ip for ip in ips if (ip['service'] & 1) == 1]
print('%s Require service bit 1' % (ip_stats(ips)), file=sys.stderr)
# Require at least 50% 30-day uptime for clearnet, 10% for onion.
req_uptime = {
'ipv4': 50,
'ipv6': 50,
'onion': 10,
}
ips = [ip for ip in ips if ip['uptime'] > req_uptime[ip['net']]]
print('%s Require minimum uptime' % (ip_stats(ips)), file=sys.stderr)
# Require at least 50% 30-day uptime.
ips = [ip for ip in ips if ip['uptime'] > 50]
# Require a known and recent user agent.
ips = [ip for ip in ips if PATTERN_AGENT.match(ip['agent'])]
print('%s Require a known and recent user agent' % (ip_stats(ips)), file=sys.stderr)
# Sort by availability (and use last success as tie breaker)
ips.sort(key=lambda x: (x['uptime'], x['lastsuccess'], x['ip']), reverse=True)
# Filter out hosts with multiple BGL ports, these are likely abusive
# Filter out hosts with multiple ports, these are likely abusive
ips = filtermultiport(ips)
print('%s Filter out hosts with multiple BGL ports' % (ip_stats(ips)), file=sys.stderr)
# Look up ASNs and limit results, both per ASN and globally.
ips = filterbyasn(ips, MAX_SEEDS_PER_ASN, NSEEDS)
print('%s Look up ASNs and limit results per ASN and per net' % (ip_stats(ips)), file=sys.stderr)
# Sort the results by IP address (for deterministic output).
ips.sort(key=lambda x: (x['net'], x['sortkey']))

for ip in ips:
if ip['net'] == 'ipv6':
print('[%s]:%i' % (ip['ip'], ip['port']))
print '[%s]:%i' % (ip['ip'], ip['port'])
else:
print('%s:%i' % (ip['ip'], ip['port']))
print '%s:%i' % (ip['ip'], ip['port'])

if __name__ == '__main__':
main()