-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement cCurl-compatibile interface
Once `BUILD_COMPAT` is set, cCurl-specific interface will be built accordingly. However, Configuration of dcurl is hardcored to [ CPU_TASK = 1, GPU_TASK = 0 ] because IOTA wallet has no chance to compute 2 more PoW tasks at the same time currently. Co-authored-by: Jim Huang <jserv.tw@gmail.com>
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright (C) 2018 dcurl Developers. | ||
* Use of this source code is governed by MIT license that can be | ||
* found in the LICENSE file. | ||
*/ | ||
|
||
#include "dcurl.h" | ||
#include <stdbool.h> | ||
|
||
static bool isInitialized = false; | ||
|
||
char *ccurl_pow(char *trytes, int mwm) | ||
{ | ||
if (!isInitialized) { | ||
dcurl_init(1, 0); | ||
isInitialized = true; | ||
} | ||
return (char *) dcurl_entry((int8_t *) trytes, mwm); | ||
} | ||
|
||
void ccurl_pow_finalize(void) | ||
{ | ||
dcurl_destroy(); | ||
} | ||
|
||
void ccurl_pow_interrupt(void) | ||
{ | ||
/* Do Nothing */ | ||
} |