The POW callback is now a service and its state stored.

The proof of work engine therefore just has to remember its initial hash making server based POW easier.
This commit is contained in:
2015-12-08 20:27:32 +01:00
parent 991a0e5f86
commit ab6a3c56dd
25 changed files with 289 additions and 103 deletions

View File

@ -36,17 +36,20 @@ import static ch.dissem.bitmessage.utils.Singleton.security;
* @author Christian Basler
*/
public class CryptoCustomMessage<T extends Streamable> extends CustomMessage {
public static final String COMMAND = "ENCRYPTED";
private final Reader<T> dataReader;
private CryptoBox container;
private BitmessageAddress sender;
private T data;
public CryptoCustomMessage(T data) throws IOException {
super(COMMAND);
this.data = data;
this.dataReader = null;
}
private CryptoCustomMessage(CryptoBox container, Reader<T> dataReader) {
super(COMMAND);
this.container = container;
this.dataReader = dataReader;
}