File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -229,9 +229,7 @@ func (m *Manager) AddBlocks(blocks []types.Block) error {
229
229
}
230
230
231
231
// if this chain is now the best chain, trigger a reorg
232
- //
233
- // TODO: SurpassThreshold?
234
- if cs .Depth .CmpWork (m .tipState .Depth ) > 0 {
232
+ if cs .SufficientlyHeavierThan (m .tipState ) {
235
233
oldTip := m .tipState .Index
236
234
if err := m .reorgTo (cs .Index ); err != nil {
237
235
if err := m .reorgTo (oldTip ); err != nil {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ go 1.21.6
4
4
5
5
require (
6
6
go.etcd.io/bbolt v1.3.9
7
- go.sia.tech/core v0.2.2
7
+ go.sia.tech/core v0.2.3-0.20240416172826-f9d44a4149e1
8
8
go.uber.org/zap v1.27.0
9
9
golang.org/x/crypto v0.22.0
10
10
lukechampine.com/frand v1.4.2
Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ go.etcd.io/bbolt v1.3.9 h1:8x7aARPEXiXbHmtUwAIv7eV2fQFHrLLavdiJ3uzJXoI=
10
10
go.etcd.io/bbolt v1.3.9 /go.mod h1:zaO32+Ti0PK1ivdPtgMESzuzL2VPoIG1PCQNvOdo/dE =
11
11
go.sia.tech/core v0.2.2 h1:33RJrt08o7KyUOY4tITH6ECmRq1lhtapqc/SncIF/2A =
12
12
go.sia.tech/core v0.2.2 /go.mod h1:Zk7HaybEPgkPC1p6e6tTQr8PIeZClTgNcLNGYDLQJeE =
13
+ go.sia.tech/core v0.2.3-0.20240416172826-f9d44a4149e1 h1:tG9JJk6qPevT2CrFttL9Y4ZIT5+RS3J+Hk9E3zJaGiY =
14
+ go.sia.tech/core v0.2.3-0.20240416172826-f9d44a4149e1 /go.mod h1:24liZWimivGQF+h3d14ly9oEpMIYxHPSgEMKmunxxi0 =
13
15
go.sia.tech/mux v1.2.0 h1:ofa1Us9mdymBbGMY2XH/lSpY8itFsKIo/Aq8zwe+GHU =
14
16
go.sia.tech/mux v1.2.0 /go.mod h1:Yyo6wZelOYTyvrHmJZ6aQfRoer3o4xyKQ4NmQLJrBSo =
15
17
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto =
You can’t perform that action at this time.
0 commit comments