fountain: decode create miner results correctly
This commit is contained in:
parent
e0d0d49ea0
commit
277c037676
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
@ -345,12 +346,13 @@ func (h *handler) msgwaitaddr(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
w.WriteHeader(200)
|
w.WriteHeader(200)
|
||||||
|
|
||||||
addr, err := address.NewFromBytes(mw.Receipt.Return)
|
var ma power.CreateMinerReturn
|
||||||
if err != nil {
|
if err := ma.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)); err != nil {
|
||||||
|
log.Errorf("%w", err)
|
||||||
w.WriteHeader(400)
|
w.WriteHeader(400)
|
||||||
w.Write([]byte(err.Error()))
|
w.Write([]byte(err.Error()))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(w, "{\"addr\": \"%s\"}", addr)
|
fmt.Fprintf(w, "{\"addr\": \"%s\"}", ma.IDAddress)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user