fiatjaf / noscl

Command line client for Nostr.
Other
269 stars 53 forks source link

Fix saving privatekey, add onlymentions #48

Open vicariousdrama opened 1 year ago

vicariousdrama commented 1 year ago
fiatjaf commented 1 year ago

@honza do you have an opinion?

vicariousdrama commented 1 year ago

getPubKey expects config.PrivateKey to be in hex format.

func getPubKey(privateKey string) string {
    if keyb, err := hex.DecodeString(config.PrivateKey); err != nil {
        log.Printf("Error decoding key from hex: %s\n", err.Error())
        return ""
    } else {
        _, pubkey := btcec.PrivKeyFromBytes(keyb)
        return hex.EncodeToString(schnorr.SerializePubKey(pubkey))
    }
}