fix a dumb bug caused by err shadow which prevented pubkey loading from working
Ted Unangst tedu@tedunangst.com
Mon, 18 Nov 2019 15:18:07 -0500
3 files changed,
10 insertions(+),
7 deletions(-)
M
activity.go
→
activity.go
@@ -1433,7 +1433,6 @@ _, err = stmtSaveXonker.Exec(keyname, data, "pubkey")
if err != nil { log.Printf("error saving key: %s", err) } - return } func ingestboxes(origin string, obj junk.Junk) {
M
docs/changelog.txt
→
docs/changelog.txt
@@ -2,6 +2,8 @@ changelog
-- next ++ Fix bug preventing import of keys + -- 0.8.2 ++ Import command to preserve those embarssassing old posts from Twitter.
M
fun.go
→
fun.go
@@ -594,15 +594,17 @@ }
allinjest(originate(keyname), j) row = stmtGetXonker.QueryRow(keyname, "pubkey") err = row.Scan(&data) - } - if err == nil { - _, key, err := httpsig.DecodeKey(data) if err != nil { - log.Printf("error decoding %s pubkey: %s", keyname, err) + log.Printf("key not found after ingesting") + return nil, true } - return key, true } - return nil, true + _, key, err := httpsig.DecodeKey(data) + if err != nil { + log.Printf("error decoding %s pubkey: %s", keyname, err) + return nil, true + } + return key, true }, Limit: 512}) func zaggy(keyname string) *rsa.PublicKey {