From 66f1d11753d30734be98ced092ea16b3d6bf1d51 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 27 Apr 2018 15:13:20 +0300 Subject: [PATCH] Handle initial MoM --- iguana/dpow/dpow_fsm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 844a9583c..b66bddcd0 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -237,9 +237,13 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu memset(MoM.bytes,0,sizeof(MoM)); if ( (infojson= dpow_getinfo(myinfo,coin)) != 0 ) { - if ( (prevMoMheight= jint(infojson,"prevMoMheight")) != 0 ) + if ( (prevMoMheight= jint(infojson,"prevMoMheight")) >= 0 ) { + if ( prevMoMheight == 0 ) + prevMoMheight = 1; *MoMdepthp = (height - prevMoMheight); + if ( *MoMdepthp > 1440*30 ) + *MoMdepthp = 1440*30; if ( *MoMdepthp > 0 && (MoMjson= issue_calcMoM(coin,height,*MoMdepthp)) != 0 ) { MoM = jbits256(MoMjson,"MoM");