Skip to content

Commit 3c152a1

Browse files
authored
Merge pull request Start9Labs#122 from Start9Labs/re-add_peers.dat_action
Re add peers.dat action
2 parents b788066 + 250afdc commit 3c152a1

File tree

3 files changed

+38
-9
lines changed

3 files changed

+38
-9
lines changed

manifest.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
id: bitcoind
22
title: "Bitcoin Core"
3-
version: 25.0.0.2
3+
version: 25.0.0.3
44
eos-version: 0.3.4.3
5-
release-notes: |
6-
* Update to latest upstream (v25.0)
7-
* Reorganize config
8-
* Force pruning for servers with not enough disk space
9-
* Update services base image to alpine 3.16
10-
* Use ssl for base image packages download
11-
* Optimized higher resolution Bitcoin icon
5+
release-notes: Add back delete-peers action
126
license: MIT
137
wrapper-repo: https://github.com/Start9Labs/bitcoind-wrapper
148
upstream-repo: https://github.com/bitcoin/bitcoin
@@ -159,6 +153,13 @@ actions:
159153
- stopped
160154
implementation:
161155
type: script
156+
delete-peers:
157+
name: "Delete Peer List"
158+
description: "Deletes the Peer List (peers.dat) in case it gets corrupted."
159+
allowed-statuses:
160+
- stopped
161+
implementation:
162+
type: script
162163
migrations:
163164
from:
164165
"*":

scripts/services/action.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,32 @@ export const action = {
2929
},
3030
};
3131
},
32+
async "delete-peers"(
33+
effect: T.Effects,
34+
_input?: T.Config
35+
): Promise<T.ResultType<T.ActionResult>> {
36+
const peersLocation = {
37+
path: "peers.dat",
38+
volumeId: "main",
39+
};
40+
if ((await util.exists(effect, peersLocation)) === false) {
41+
return {
42+
result: {
43+
copyable: false,
44+
message: "peers.dat doesn't exist",
45+
version: "0",
46+
qr: false,
47+
},
48+
};
49+
}
50+
await effect.removeFile(peersLocation);
51+
return {
52+
result: {
53+
copyable: false,
54+
message: "Deleted peers.dat",
55+
version: "0",
56+
qr: false,
57+
},
58+
};
59+
},
3260
};

scripts/services/migrations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,5 +230,5 @@ export const migration: T.ExpectedExports.migration =
230230
),
231231
},
232232
},
233-
"25.0.0.2"
233+
"25.0.0.3"
234234
);

0 commit comments

Comments
 (0)