Merge pull request #3131 from filecoin-project/asr/no-peerid

strip peerid when setting on-chain addrs
This commit is contained in:
Łukasz Magiera 2020-08-18 03:21:42 +02:00 committed by GitHub
commit b463749594
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,14 @@ var actorSetAddrsCmd = &cli.Command{
return fmt.Errorf("failed to parse %q as a multiaddr: %w", a, err)
}
addrs = append(addrs, maddr.Bytes())
maddrNop2p, strip := ma.SplitFunc(maddr, func(c ma.Component) bool {
return c.Protocol().Code == ma.P_P2P
})
if strip != nil {
fmt.Println("Stripping peerid ", strip, " from ", maddr)
}
addrs = append(addrs, maddrNop2p.Bytes())
}
maddr, err := nodeAPI.ActorAddress(ctx)