diff --git a/core/blockchain.go b/core/blockchain.go index 53c6f79d5..2eedcc8fc 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -1975,7 +1975,7 @@ func (bc *BlockChain) DeleteFromPendingSlashingCandidates( bc.pendingSlashingCandidatesMU.Lock() defer bc.pendingSlashingCandidatesMU.Unlock() current := bc.ReadPendingSlashingCandidates() - bc.pendingSlashes = current.SetDifference(processed) + bc.pendingSlashes = processed.SetDifference(current) return bc.writeSlashes(bc.pendingSlashes) } diff --git a/core/rawdb/accessors_offchain.go b/core/rawdb/accessors_offchain.go index 537e4cd83..b3c9294c0 100644 --- a/core/rawdb/accessors_offchain.go +++ b/core/rawdb/accessors_offchain.go @@ -79,17 +79,6 @@ func WritePendingCrossLinks(db DatabaseWriter, bytes []byte) error { return db.Put(pendingCrosslinkKey, bytes) } -// DeletePendingCrossLinks stores last pending crosslinks into database. -func DeletePendingCrossLinks(db DatabaseDeleter) error { - return db.Delete(pendingCrosslinkKey) -} - -// ReadPendingSlashingCandidates retrieves last pending slashing candidates -// TODO(audit): the pending slashes written in DB is never used. -func ReadPendingSlashingCandidates(db DatabaseReader) ([]byte, error) { - return db.Get(pendingSlashingKey) -} - // WritePendingSlashingCandidates stores last pending slashing candidates into database. func WritePendingSlashingCandidates(db DatabaseWriter, bytes []byte) error { return db.Put(pendingSlashingKey, bytes) diff --git a/core/state_processor.go b/core/state_processor.go index 12b198f7c..6664f5056 100644 --- a/core/state_processor.go +++ b/core/state_processor.go @@ -274,7 +274,6 @@ func ApplyStakingTransaction( receipt.TxHash = tx.Hash() receipt.GasUsed = gas - // TODO(audit): add more log to staking txns; expose them in block explorer. if config.IsReceiptLog(header.Epoch()) { receipt.Logs = statedb.GetLogs(tx.Hash()) utils.Logger().Info().Interface("CollectReward", receipt.Logs) diff --git a/node/worker/worker.go b/node/worker/worker.go index f43a05092..5da32f2cb 100644 --- a/node/worker/worker.go +++ b/node/worker/worker.go @@ -405,6 +405,7 @@ func (w *Worker) verifySlashes( Interface("slashRecord", d[i]). Msg("Slash failed verification") failures = append(failures, d[i]) + continue } successes = append(successes, d[i]) }