Skip to content

Commit 13b93fb

Browse files
authored
Merge pull request #11284 from vegaprotocol/pow-fix
fix: do not account for started block in the past block range
2 parents 8f33438 + b9db6e2 commit 13b93fb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

core/pow/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func (e *Engine) updatePowState(txs []abci.Tx) {
250250
}
251251

252252
for i, p := range e.activeParams {
253-
outOfScopeBlock := int64(e.currentBlock) + 1 - int64(p.spamPoWNumberOfPastBlocks)
253+
outOfScopeBlock := int64(e.currentBlock) - int64(p.spamPoWNumberOfPastBlocks)
254254
if outOfScopeBlock < 0 {
255255
continue
256256
}

core/pow/engine_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ func TestDeliverTxDuplciateNonce(t *testing.T) {
232232
require.Equal(t, 2, len(e.heightToNonceRef[100]))
233233

234234
// check the maps are purged when we leave scope
235-
e.BeginBlock(104, crypto.RandomHash(), []abci.Tx{})
235+
e.BeginBlock(105, crypto.RandomHash(), []abci.Tx{})
236236
require.Equal(t, 0, len(e.seenTid))
237237
require.Equal(t, 0, len(e.heightToTid))
238238
require.Equal(t, 0, len(e.heightToNonceRef))

0 commit comments

Comments
 (0)