consensus: delete unused functions rlpHash (#1749)

This commit is contained in:
wit liu 2025-11-14 22:35:20 +08:00 committed by GitHub
parent 7641bcfd19
commit 812abd4b83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,7 +10,6 @@ import (
"github.com/XinFinOrg/XDPoSChain/common"
"github.com/XinFinOrg/XDPoSChain/log"
"github.com/XinFinOrg/XDPoSChain/rlp"
"golang.org/x/crypto/sha3"
)
func Position(list []common.Address, x common.Address) int {
@ -89,13 +88,3 @@ func DecodeBytesExtraFields(b []byte, val interface{}) error {
return fmt.Errorf("consensus version %d is not defined, or this block is v1 block", b[0])
}
}
func rlpHash(x interface{}) (h common.Hash) {
hw := sha3.NewLegacyKeccak256()
err := rlp.Encode(hw, x)
if err != nil {
log.Error("[rlpHash] Fail to hash item", "Error", err)
}
hw.Sum(h[:0])
return h
}