decentralized -> peer discovery

This commit is contained in:
mr
2026-01-26 11:23:04 +01:00
parent 9e4d31e797
commit 07ec659bb4
6 changed files with 215 additions and 134 deletions

View File

@@ -16,7 +16,7 @@ func verify(pub crypto.PubKey, data, sig []byte) (bool, error) {
return pub.Verify(data, sig)
}
func loadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
func LoadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
path := conf.GetConfig().PrivateKeyPath
if isPublic {
path = conf.GetConfig().PublicKeyPath
@@ -35,12 +35,12 @@ func loadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
}
func VerifyPubWithPriv() bool {
priv, err := loadKeyFromFile(false)
priv, err := LoadKeyFromFile(false)
if err != nil {
fmt.Println(err)
return false
}
pub, err := loadKeyFromFile(true)
pub, err := LoadKeyFromFile(true)
if err != nil {
fmt.Println(err)
return false