Skip to content

Commit a7ce5ac

Browse files
committed
multi: add forknet support + CI builds
1 parent 4bce545 commit a7ce5ac

File tree

8 files changed

+1967
-2
lines changed

8 files changed

+1967
-2
lines changed

.github/workflows/build.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: Build Electrum
2+
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
- 'v*'
8+
workflow_dispatch:
9+
inputs:
10+
create_release:
11+
description: 'Create a GitHub release'
12+
required: false
13+
type: boolean
14+
default: false
15+
16+
jobs:
17+
build-linux:
18+
name: Build Linux AppImage
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
submodules: recursive
26+
27+
- name: Set up Docker Buildx
28+
uses: docker/setup-buildx-action@v3
29+
30+
- name: Build AppImage
31+
run: |
32+
cd contrib/build-linux/appimage
33+
./build.sh
34+
35+
- name: Get version
36+
id: version
37+
run: |
38+
VERSION=$(python3 contrib/print_electrum_version.py)
39+
echo "version=$VERSION" >> $GITHUB_OUTPUT
40+
echo "Version: $VERSION"
41+
42+
- name: Upload AppImage
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: linux-appimage
46+
path: dist/*.AppImage
47+
if-no-files-found: error
48+
49+
build-windows:
50+
name: Build Windows Executables
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v4
56+
with:
57+
submodules: recursive
58+
59+
- name: Set up Docker Buildx
60+
uses: docker/setup-buildx-action@v3
61+
62+
- name: Build Windows executables
63+
run: |
64+
cd contrib/build-wine
65+
./build.sh
66+
67+
- name: Get version
68+
id: version
69+
run: |
70+
VERSION=$(python3 contrib/print_electrum_version.py)
71+
echo "version=$VERSION" >> $GITHUB_OUTPUT
72+
echo "Version: $VERSION"
73+
74+
- name: Upload Windows executables
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: windows-executables
78+
path: |
79+
contrib/build-wine/dist/*-portable.exe
80+
contrib/build-wine/dist/electrum-*.exe
81+
if-no-files-found: error
82+
83+
build-macos:
84+
name: Build macOS DMG
85+
runs-on: macos-latest
86+
87+
steps:
88+
- name: Checkout code
89+
uses: actions/checkout@v4
90+
with:
91+
submodules: recursive
92+
93+
# Build script expects a specific Python version
94+
- name: Pin Python version
95+
uses: actions/setup-python@v6
96+
with:
97+
python-version: '3.12.10'
98+
99+
- name: Install build dependencies
100+
run: |
101+
brew install autoconf automake libtool gettext coreutils
102+
103+
- name: Build macOS app
104+
run: |
105+
cd contrib/osx
106+
./make_osx.sh
107+
108+
- name: Get version
109+
id: version
110+
run: |
111+
VERSION=$(python3 contrib/print_electrum_version.py)
112+
echo "version=$VERSION" >> $GITHUB_OUTPUT
113+
echo "Version: $VERSION"
114+
115+
- name: Upload DMG
116+
uses: actions/upload-artifact@v4
117+
with:
118+
name: macos-dmg
119+
path: dist/*.dmg
120+
if-no-files-found: error
121+

electrum/blockchain.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,10 @@ def verify_header(cls, header: dict, prev_hash: str, target: int, expected_heade
312312
raise InvalidHeader("prev hash mismatch: %s vs %s" % (prev_hash, header.get('prev_block_hash')))
313313
if constants.net.TESTNET:
314314
return
315+
# Skip strict difficulty verification for drivechain network
316+
# Drivechain may have different difficulty adjustment rules
317+
if constants.net.NET_NAME == 'drivechain':
318+
return
315319
bits = cls.target_to_bits(target)
316320
if bits != header.get('bits'):
317321
raise InvalidHeader("bits mismatch: %s vs %s" % (bits, header.get('bits')))

0 commit comments

Comments
 (0)