Sync only missing blocks on cold import
= Add eth_node_fingerprint to block that can be imitated by both hot and cold imports - Only sync missing blocks (blocks that are missing or don't share a fingerprint) on cold import - Set block is_final status after import
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package crypto
|
||||
|
||||
import (
|
||||
"github.com/ethereum/go-ethereum/crypto"
|
||||
"github.com/ethereum/go-ethereum/p2p/discover"
|
||||
)
|
||||
|
||||
type PublicKeyParser interface {
|
||||
ParsePublicKey(privateKey string) (string, error)
|
||||
}
|
||||
|
||||
type EthPublicKeyParser struct{}
|
||||
|
||||
func (EthPublicKeyParser) ParsePublicKey(privateKey string) (string, error) {
|
||||
np, err := crypto.HexToECDSA(privateKey)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
pubKey := discover.PubkeyID(&np.PublicKey)
|
||||
return pubKey.String(), nil
|
||||
}
|
||||
Reference in New Issue
Block a user