Skip to content

Commit

Permalink
Add post-server to genProof call
Browse files Browse the repository at this point in the history
  • Loading branch information
hairtail committed Feb 20, 2024
1 parent db16ee1 commit 26950ec
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/postrs/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func WithPowCreator(id []byte) PostOptionFunc {
}
}

func GenerateProof(dataDir string, challenge []byte, logger *zap.Logger, nonces, threads uint, K1, K2 uint32, powDifficulty [32]byte, powFlags PowFlags, options ...PostOptionFunc) (*shared.Proof, error) {
func GenerateProof(dataDir string, postServer string, challenge []byte, logger *zap.Logger, nonces, threads uint, K1, K2 uint32, powDifficulty [32]byte, powFlags PowFlags, options ...PostOptionFunc) (*shared.Proof, error) {
opts := postOptions{}
for _, o := range options {
if err := o(&opts); err != nil {
Expand All @@ -70,6 +70,9 @@ func GenerateProof(dataDir string, challenge []byte, logger *zap.Logger, nonces,
dataDirPtr := C.CString(dataDir)
defer C.free(unsafe.Pointer(dataDirPtr))

postServerPtr := C.CString(postServer)
defer C.free(unsafe.Pointer(&postServerPtr))

challengePtr := C.CBytes(challenge)
defer C.free(challengePtr)

Expand All @@ -96,6 +99,7 @@ func GenerateProof(dataDir string, challenge []byte, logger *zap.Logger, nonces,
C.size_t(threads),
powFlags,
(*C.uchar)(powCreatorId),
postServerPtr,
)

if cProof == nil {
Expand Down

0 comments on commit 26950ec

Please sign in to comment.