From ce7b7c33300eae8da32d25448fdd5ab72d4dccd1 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 21:39:07 -1100 Subject: [PATCH 01/14] +msg --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index f2d733a62..83762eaf7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4276,6 +4276,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo ASSETCHAINS_SYMBOL,pindexFork->phashBlock->GetHex(), pindexFork->GetHeight()) + "\n\n" + _("Please help, human!"); LogPrintf("*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); + fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_ERROR); StartShutdown(); return false; From 78f4a6c6271259c4574b75d237804d2aa5b0dab7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 21:40:46 -1100 Subject: [PATCH 02/14] c_str() --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 83762eaf7..8e836ffa0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4276,7 +4276,7 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo ASSETCHAINS_SYMBOL,pindexFork->phashBlock->GetHex(), pindexFork->GetHeight()) + "\n\n" + _("Please help, human!"); LogPrintf("*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); - fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg,reorgLength+10); + fprintf(stderr,"*** %s\nif you launch with -maxreorg=%d it might be able to resolve this automatically", msg.c_str(),reorgLength+10); uiInterface.ThreadSafeMessageBox(msg, "", CClientUIInterface::MSG_ERROR); StartShutdown(); return false; From 548c2819750936bf4b4c29806e3f8e60577b66bb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 22:34:28 -1100 Subject: [PATCH 03/14] Extract zombies for comparison --- src/cc/rogue/main.c | 6 + src/cc/rogue/passages.c | 416 ++++++++++++++++++++-------------------- src/cc/rogue/rings.c | 128 ++++++------- src/cc/rogue/rogue.c | 18 +- src/cc/rogue_rpc.cpp | 8 +- 5 files changed, 296 insertions(+), 280 deletions(-) diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index 7b68aa49e..eeb085192 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -235,6 +235,7 @@ int32_t safecopy(char *dest,char *src,long len) #endif int32_t rogue_replay(uint64_t seed,int32_t sleeptime); +char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter); int rogue(int argc, char **argv, char **envp); void *OS_loadfile(char *fname,uint8_t **bufp,long *lenp,long *allocsizep) @@ -762,6 +763,11 @@ void rogue_progress(struct rogue_state *rs,int32_t waitflag,uint64_t seed,char * } free(rs->keystrokeshex), rs->keystrokeshex = 0; } + if ( (pastkeys= rogue_keystrokesload(&numpastkeys,seed,1)) != 0 ) + { + free(pastkeys); + } + for (i=0; iisconn[j] = FALSE; - r1->ingraph = FALSE; + for (j = 0; j < MAXROOMS; j++) + r1->isconn[j] = FALSE; + r1->ingraph = FALSE; } - + /* * starting with one room, connect it to a random adjacent room and * then pick a new room to start with. @@ -61,65 +61,65 @@ do_passages(struct rogue_state *rs) r1->ingraph = TRUE; do { - /* - * find a room to connect with - */ - j = 0; - for (i = 0; i < MAXROOMS; i++) - if (r1->conn[i] && !rdes[i].ingraph && rnd(++j) == 0) - r2 = &rdes[i]; - /* - * if no adjacent rooms are outside the graph, pick a new room - * to look from - */ - if (j == 0) - { - do - r1 = &rdes[rnd(MAXROOMS)]; - until (r1->ingraph); - } - /* - * otherwise, connect new room to the graph, and draw a tunnel - * to it - */ - else - { - r2->ingraph = TRUE; - i = (int)(r1 - rdes); - j = (int)(r2 - rdes); - conn(rs,i, j); - r1->isconn[j] = TRUE; - r2->isconn[i] = TRUE; - roomcount++; - } + /* + * find a room to connect with + */ + j = 0; + for (i = 0; i < MAXROOMS; i++) + if (r1->conn[i] && !rdes[i].ingraph && rnd(++j) == 0) + r2 = &rdes[i]; + /* + * if no adjacent rooms are outside the graph, pick a new room + * to look from + */ + if (j == 0) + { + do + r1 = &rdes[rnd(MAXROOMS)]; + until (r1->ingraph); + } + /* + * otherwise, connect new room to the graph, and draw a tunnel + * to it + */ + else + { + r2->ingraph = TRUE; + i = (int)(r1 - rdes); + j = (int)(r2 - rdes); + conn(rs,i, j); + r1->isconn[j] = TRUE; + r2->isconn[i] = TRUE; + roomcount++; + } } while (roomcount < MAXROOMS); - + /* * attempt to add passages to the graph a random number of times so * that there isn't always just one unique passage through it. */ for (roomcount = rnd(5); roomcount > 0; roomcount--) { - r1 = &rdes[rnd(MAXROOMS)]; /* a random room to look from */ - /* - * find an adjacent room not already connected - */ - j = 0; - for (i = 0; i < MAXROOMS; i++) - if (r1->conn[i] && !r1->isconn[i] && rnd(++j) == 0) - r2 = &rdes[i]; - /* - * if there is one, connect it and look for the next added - * passage - */ - if (j != 0) - { - i = (int)(r1 - rdes); - j = (int)(r2 - rdes); - conn(rs,i, j); - r1->isconn[j] = TRUE; - r2->isconn[i] = TRUE; - } + r1 = &rdes[rnd(MAXROOMS)]; /* a random room to look from */ + /* + * find an adjacent room not already connected + */ + j = 0; + for (i = 0; i < MAXROOMS; i++) + if (r1->conn[i] && !r1->isconn[i] && rnd(++j) == 0) + r2 = &rdes[i]; + /* + * if there is one, connect it and look for the next added + * passage + */ + if (j != 0) + { + i = (int)(r1 - rdes); + j = (int)(r2 - rdes); + conn(rs,i, j); + r1->isconn[j] = TRUE; + r2->isconn[i] = TRUE; + } } passnum(); } @@ -138,22 +138,22 @@ conn(struct rogue_state *rs,int r1, int r2) int rm; char direc; static coord del, curr, turn_delta, spos, epos; - + if (r1 < r2) { - rm = r1; - if (r1 + 1 == r2) - direc = 'r'; - else - direc = 'd'; + rm = r1; + if (r1 + 1 == r2) + direc = 'r'; + else + direc = 'd'; } else { - rm = r2; - if (r2 + 1 == r1) - direc = 'r'; - else - direc = 'd'; + rm = r2; + if (r2 + 1 == r1) + direc = 'r'; + else + direc = 'd'; } rpf = &rooms[rm]; /* @@ -162,75 +162,75 @@ conn(struct rogue_state *rs,int r1, int r2) */ if (direc == 'd') { - rmt = rm + 3; /* room # of dest */ - rpt = &rooms[rmt]; /* room pointer of dest */ - del.x = 0; /* direction of move */ - del.y = 1; - spos.x = rpf->r_pos.x; /* start of move */ - spos.y = rpf->r_pos.y; - epos.x = rpt->r_pos.x; /* end of move */ - epos.y = rpt->r_pos.y; - if (!(rpf->r_flags & ISGONE)) /* if not gone pick door pos */ - do - { - spos.x = rpf->r_pos.x + rnd(rpf->r_max.x - 2) + 1; - spos.y = rpf->r_pos.y + rpf->r_max.y - 1; - } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); - if (!(rpt->r_flags & ISGONE)) - do - { - epos.x = rpt->r_pos.x + rnd(rpt->r_max.x - 2) + 1; - } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); - distance = abs(spos.y - epos.y) - 1; /* distance to move */ - turn_delta.y = 0; /* direction to turn */ - turn_delta.x = (spos.x < epos.x ? 1 : -1); - turn_distance = abs(spos.x - epos.x); /* how far to turn */ + rmt = rm + 3; /* room # of dest */ + rpt = &rooms[rmt]; /* room pointer of dest */ + del.x = 0; /* direction of move */ + del.y = 1; + spos.x = rpf->r_pos.x; /* start of move */ + spos.y = rpf->r_pos.y; + epos.x = rpt->r_pos.x; /* end of move */ + epos.y = rpt->r_pos.y; + if (!(rpf->r_flags & ISGONE)) /* if not gone pick door pos */ + do + { + spos.x = rpf->r_pos.x + rnd(rpf->r_max.x - 2) + 1; + spos.y = rpf->r_pos.y + rpf->r_max.y - 1; + } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); + if (!(rpt->r_flags & ISGONE)) + do + { + epos.x = rpt->r_pos.x + rnd(rpt->r_max.x - 2) + 1; + } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); + distance = abs(spos.y - epos.y) - 1; /* distance to move */ + turn_delta.y = 0; /* direction to turn */ + turn_delta.x = (spos.x < epos.x ? 1 : -1); + turn_distance = abs(spos.x - epos.x); /* how far to turn */ } else if (direc == 'r') /* setup for moving right */ { - rmt = rm + 1; - rpt = &rooms[rmt]; - del.x = 1; - del.y = 0; - spos.x = rpf->r_pos.x; - spos.y = rpf->r_pos.y; - epos.x = rpt->r_pos.x; - epos.y = rpt->r_pos.y; - if (!(rpf->r_flags & ISGONE)) - do - { - spos.x = rpf->r_pos.x + rpf->r_max.x - 1; - spos.y = rpf->r_pos.y + rnd(rpf->r_max.y - 2) + 1; - } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); - if (!(rpt->r_flags & ISGONE)) - do - { - epos.y = rpt->r_pos.y + rnd(rpt->r_max.y - 2) + 1; - } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); - distance = abs(spos.x - epos.x) - 1; - turn_delta.y = (spos.y < epos.y ? 1 : -1); - turn_delta.x = 0; - turn_distance = abs(spos.y - epos.y); + rmt = rm + 1; + rpt = &rooms[rmt]; + del.x = 1; + del.y = 0; + spos.x = rpf->r_pos.x; + spos.y = rpf->r_pos.y; + epos.x = rpt->r_pos.x; + epos.y = rpt->r_pos.y; + if (!(rpf->r_flags & ISGONE)) + do + { + spos.x = rpf->r_pos.x + rpf->r_max.x - 1; + spos.y = rpf->r_pos.y + rnd(rpf->r_max.y - 2) + 1; + } while ((rpf->r_flags&ISMAZE) && !(flat(spos.y, spos.x)&F_PASS)); + if (!(rpt->r_flags & ISGONE)) + do + { + epos.y = rpt->r_pos.y + rnd(rpt->r_max.y - 2) + 1; + } while ((rpt->r_flags&ISMAZE) && !(flat(epos.y, epos.x)&F_PASS)); + distance = abs(spos.x - epos.x) - 1; + turn_delta.y = (spos.y < epos.y ? 1 : -1); + turn_delta.x = 0; + turn_distance = abs(spos.y - epos.y); } #ifdef MASTER else - debug("error in connection tables"); + debug("error in connection tables"); #endif - + turn_spot = rnd(distance - 1) + 1; /* where turn starts */ - + /* * Draw in the doors on either side of the passage or just put #'s * if the rooms are gone. */ if (!(rpf->r_flags & ISGONE)) - door(rpf, &spos); + door(rpf, &spos); else - putpass(&spos); + putpass(&spos); if (!(rpt->r_flags & ISGONE)) - door(rpt, &epos); + door(rpt, &epos); else - putpass(&epos); + putpass(&epos); /* * Get ready to move... */ @@ -238,31 +238,31 @@ conn(struct rogue_state *rs,int r1, int r2) curr.y = spos.y; while (distance > 0) { - /* - * Move to new position - */ - curr.x += del.x; - curr.y += del.y; - /* - * Check if we are at the turn place, if so do the turn - */ - if (distance == turn_spot) - while (turn_distance--) - { - putpass(&curr); - curr.x += turn_delta.x; - curr.y += turn_delta.y; - } - /* - * Continue digging along - */ - putpass(&curr); - distance--; + /* + * Move to new position + */ + curr.x += del.x; + curr.y += del.y; + /* + * Check if we are at the turn place, if so do the turn + */ + if (distance == turn_spot) + while (turn_distance--) + { + putpass(&curr); + curr.x += turn_delta.x; + curr.y += turn_delta.y; + } + /* + * Continue digging along + */ + putpass(&curr); + distance--; } curr.x += del.x; curr.y += del.y; if (!ce(curr, epos)) - msg(rs,"warning, connectivity problem on this level"); + msg(rs,"warning, connectivity problem on this level"); } /* @@ -274,13 +274,13 @@ void putpass(coord *cp) { PLACE *pp; - + pp = INDEX(cp->y, cp->x); pp->p_flags |= F_PASS; if (rnd(10) + 1 < level && rnd(40) == 0) - pp->p_flags &= ~F_REAL; + pp->p_flags &= ~F_REAL; else - pp->p_ch = PASSAGE; + pp->p_ch = PASSAGE; } /* @@ -293,23 +293,23 @@ void door(struct room *rm, coord *cp) { PLACE *pp; - + rm->r_exit[rm->r_nexits++] = *cp; - + if (rm->r_flags & ISMAZE) - return; - + return; + pp = INDEX(cp->y, cp->x); if (rnd(10) + 1 < level && rnd(5) == 0) { - if (cp->y == rm->r_pos.y || cp->y == rm->r_pos.y + rm->r_max.y - 1) - pp->p_ch = '-'; - else - pp->p_ch = '|'; - pp->p_flags &= ~F_REAL; + if (cp->y == rm->r_pos.y || cp->y == rm->r_pos.y + rm->r_max.y - 1) + pp->p_ch = '-'; + else + pp->p_ch = '|'; + pp->p_flags &= ~F_REAL; } else - pp->p_ch = DOOR; + pp->p_ch = DOOR; } #ifdef MASTER @@ -324,31 +324,31 @@ add_pass() PLACE *pp; int y, x; char ch; - + for (y = 1; y < NUMLINES - 1; y++) - for (x = 0; x < NUMCOLS; x++) - { - pp = INDEX(y, x); - if ((pp->p_flags & F_PASS) || pp->p_ch == DOOR || - (!(pp->p_flags&F_REAL) && (pp->p_ch == '|' || pp->p_ch == '-'))) - { - ch = pp->p_ch; - if (pp->p_flags & F_PASS) - ch = PASSAGE; - pp->p_flags |= F_SEEN; - move(y, x); - if (pp->p_monst != NULL) - pp->p_monst->t_oldch = pp->p_ch; - else if (pp->p_flags & F_REAL) - addch(ch); - else - { - standout(); - addch((pp->p_flags & F_PASS) ? PASSAGE : DOOR); - standend(); - } - } - } + for (x = 0; x < NUMCOLS; x++) + { + pp = INDEX(y, x); + if ((pp->p_flags & F_PASS) || pp->p_ch == DOOR || + (!(pp->p_flags&F_REAL) && (pp->p_ch == '|' || pp->p_ch == '-'))) + { + ch = pp->p_ch; + if (pp->p_flags & F_PASS) + ch = PASSAGE; + pp->p_flags |= F_SEEN; + move(y, x); + if (pp->p_monst != NULL) + pp->p_monst->t_oldch = pp->p_ch; + else if (pp->p_flags & F_REAL) + addch(ch); + else + { + standout(); + addch((pp->p_flags & F_PASS) ? PASSAGE : DOOR); + standend(); + } + } + } } #endif @@ -365,17 +365,17 @@ passnum() { struct room *rp; int i; - + pnum = 0; newpnum = FALSE; for (rp = passages; rp < &passages[MAXPASS]; rp++) - rp->r_nexits = 0; + rp->r_nexits = 0; for (rp = rooms; rp < &rooms[MAXROOMS]; rp++) - for (i = 0; i < rp->r_nexits; i++) - { - newpnum ^= 1;//newpnum++; - numpass(rp->r_exit[i].y, rp->r_exit[i].x); - } + for (i = 0; i < rp->r_nexits; i++) + { + newpnum ^= 1;//newpnum++; + numpass(rp->r_exit[i].y, rp->r_exit[i].x); + } } /* @@ -389,30 +389,30 @@ numpass(int y, int x) char *fp; struct room *rp; char ch; - + if (x >= NUMCOLS || x < 0 || y >= NUMLINES || y <= 0) - return; + return; fp = &flat(y, x); if (*fp & F_PNUM) - return; + return; if (newpnum) { - pnum++; - newpnum = FALSE; + pnum++; + newpnum = FALSE; } /* * check to see if it is a door or secret door, i.e., a new exit, * or a numerable type of place */ if ((ch = chat(y, x)) == DOOR || - (!(*fp & F_REAL) && (ch == '|' || ch == '-'))) + (!(*fp & F_REAL) && (ch == '|' || ch == '-'))) { - rp = &passages[pnum]; - rp->r_exit[rp->r_nexits].y = y; - rp->r_exit[rp->r_nexits++].x = x; + rp = &passages[pnum]; + rp->r_exit[rp->r_nexits].y = y; + rp->r_exit[rp->r_nexits++].x = x; } else if (!(*fp & F_PASS)) - return; + return; *fp |= pnum; /* * recurse on the surrounding places diff --git a/src/cc/rogue/rings.c b/src/cc/rogue/rings.c index af6cc881b..f9ce50795 100644 --- a/src/cc/rogue/rings.c +++ b/src/cc/rogue/rings.c @@ -23,65 +23,65 @@ ring_on(struct rogue_state *rs) { THING *obj; int ring; - + obj = get_item(rs,"put on", RING); /* * Make certain that it is somethings that we want to wear */ if (obj == NULL) - return; + return; if (obj->o_type != RING) { - if (!terse) - msg(rs,"it would be difficult to wrap that around a finger"); - else - msg(rs,"not a ring"); - return; + if (!terse) + msg(rs,"it would be difficult to wrap that around a finger"); + else + msg(rs,"not a ring"); + return; } - + /* * find out which hand to put it on */ if (is_current(rs,obj)) - return; - + return; + if (cur_ring[LEFT] == NULL && cur_ring[RIGHT] == NULL) { - if ((ring = gethand(rs)) < 0) - return; + if ((ring = gethand(rs)) < 0) + return; } else if (cur_ring[LEFT] == NULL) - ring = LEFT; + ring = LEFT; else if (cur_ring[RIGHT] == NULL) - ring = RIGHT; + ring = RIGHT; else { - if (!terse) - msg(rs,"you already have a ring on each hand"); - else - msg(rs,"wearing two"); - return; + if (!terse) + msg(rs,"you already have a ring on each hand"); + else + msg(rs,"wearing two"); + return; } cur_ring[ring] = obj; - + /* * Calculate the effect it has on the poor guy. */ switch (obj->o_which) { - case R_ADDSTR: - chg_str(obj->o_arm); - break; - case R_SEEINVIS: - invis_on(); - break; - case R_AGGR: - aggravate(rs); - break; + case R_ADDSTR: + chg_str(obj->o_arm); + break; + case R_SEEINVIS: + invis_on(); + break; + case R_AGGR: + aggravate(rs); + break; } - + if (!terse) - addmsg(rs,"you are now wearing "); + addmsg(rs,"you are now wearing "); msg(rs,"%s (%c)", inv_name(obj, TRUE), obj->o_packch); } @@ -95,31 +95,31 @@ ring_off(struct rogue_state *rs) { int ring; THING *obj; - + if (cur_ring[LEFT] == NULL && cur_ring[RIGHT] == NULL) { - if (terse) - msg(rs,"no rings"); - else - msg(rs,"you aren't wearing any rings"); - return; + if (terse) + msg(rs,"no rings"); + else + msg(rs,"you aren't wearing any rings"); + return; } else if (cur_ring[LEFT] == NULL) - ring = RIGHT; + ring = RIGHT; else if (cur_ring[RIGHT] == NULL) - ring = LEFT; + ring = LEFT; else - if ((ring = gethand(rs)) < 0) - return; + if ((ring = gethand(rs)) < 0) + return; mpos = 0; obj = cur_ring[ring]; if (obj == NULL) { - msg(rs,"not wearing such a ring"); - return; + msg(rs,"not wearing such a ring"); + return; } if (dropcheck(rs,obj)) - msg(rs,"was wearing %s(%c)", inv_name(obj, TRUE), obj->o_packch); + msg(rs,"was wearing %s(%c)", inv_name(obj, TRUE), obj->o_packch); } /* @@ -163,21 +163,21 @@ ring_eat(int hand) THING *ring; int eat; static int uses[] = { - 1, /* R_PROTECT */ 1, /* R_ADDSTR */ - 1, /* R_SUSTSTR */ -3, /* R_SEARCH */ - -5, /* R_SEEINVIS */ 0, /* R_NOP */ - 0, /* R_AGGR */ -3, /* R_ADDHIT */ - -3, /* R_ADDDAM */ 2, /* R_REGEN */ - -2, /* R_DIGEST */ 0, /* R_TELEPORT */ - 1, /* R_STEALTH */ 1 /* R_SUSTARM */ + 1, /* R_PROTECT */ 1, /* R_ADDSTR */ + 1, /* R_SUSTSTR */ -3, /* R_SEARCH */ + -5, /* R_SEEINVIS */ 0, /* R_NOP */ + 0, /* R_AGGR */ -3, /* R_ADDHIT */ + -3, /* R_ADDDAM */ 2, /* R_REGEN */ + -2, /* R_DIGEST */ 0, /* R_TELEPORT */ + 1, /* R_STEALTH */ 1 /* R_SUSTARM */ }; - + if ((ring = cur_ring[hand]) == NULL) - return 0; + return 0; if ((eat = uses[ring->o_which]) < 0) - eat = (rnd(-eat) == 0); + eat = (rnd(-eat) == 0); if (ring->o_which == R_DIGEST) - eat = -eat; + eat = -eat; return eat; } @@ -189,18 +189,18 @@ char * ring_num(THING *obj) { static char buf[10]; - + if (!(obj->o_flags & ISKNOW)) - return ""; + return ""; switch (obj->o_which) { - case R_PROTECT: - case R_ADDSTR: - case R_ADDDAM: - case R_ADDHIT: - sprintf(buf, " [%s]", num(obj->o_arm, 0, RING)); - otherwise: - return ""; + case R_PROTECT: + case R_ADDSTR: + case R_ADDDAM: + case R_ADDHIT: + sprintf(buf, " [%s]", num(obj->o_arm, 0, RING)); + otherwise: + return ""; } return buf; } diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index ca0c92343..57890207b 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -254,11 +254,10 @@ long get_filesize(FILE *fp) return(fsize); } -int32_t rogue_replay(uint64_t seed,int32_t sleeptime) +char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) { - FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; - if ( seed == 0 ) - seed = 777; + char fname[1024],*keystrokes = 0; FILE *fp; long fsize; int32_t num = 0; + *numkeysp = 0; while ( 1 ) { roguefname(fname,seed,counter); @@ -288,6 +287,16 @@ int32_t rogue_replay(uint64_t seed,int32_t sleeptime) counter++; fprintf(stderr,"loaded %ld from (%s) total %ld\n",fsize,fname,num); } + *numkeysp = num; + return(keystrokes); +} + +int32_t rogue_replay(uint64_t seed,int32_t sleeptime) +{ + FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; + if ( seed == 0 ) + seed = 777; + keystrokes = rogue_keystrokesload(&num,seed,counter); if ( num > 0 ) { sprintf(fname,"rogue.%llu.player",(long long)seed); @@ -301,7 +310,6 @@ int32_t rogue_replay(uint64_t seed,int32_t sleeptime) fclose(fp); } rogue_replay2(0,seed,keystrokes,num,player,sleeptime); - mvaddstr(LINES - 2, 0, (char *)"replay completed"); endwin(); my_exit(0); diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index c5370309d..dce56f6a1 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -978,16 +978,18 @@ char *rogue_extractgame(int32_t makefiles,char *str,int32_t *numkeysp,std::vecto } if ( endP.gold <= 0 || endP.hitpoints <= 0 || (endP.strength&0xffff) <= 0 || endP.level <= 0 || endP.experience <= 0 || endP.dungeonlevel <= 0 ) { - fprintf(stderr,"zero value character was killed -> no playerdata\n"); + sprintf(str,"zero value character was killed -> no playerdata\n"); newdata.resize(0); - //P.gold = (P.gold * 8) / 10; + *numkeysp = numkeys; + return(keystrokes); + /* P.gold = (P.gold * 8) / 10; if ( keystrokes != 0 ) { free(keystrokes); keystrokes = 0; *numkeysp = 0; return(keystrokes); - } + }*/ } else { From 59725a3c3e47ee54cb068735360ae5b063dda2f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 22:36:38 -1100 Subject: [PATCH 04/14] Syntax --- src/cc/rogue/main.c | 2 +- src/cc/rogue/rogue.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cc/rogue/main.c b/src/cc/rogue/main.c index eeb085192..4e6221aa1 100644 --- a/src/cc/rogue/main.c +++ b/src/cc/rogue/main.c @@ -742,7 +742,7 @@ int32_t rogue_sendrawtransaction(char *rawtx) void rogue_progress(struct rogue_state *rs,int32_t waitflag,uint64_t seed,char *keystrokes,int32_t num) { - char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx; int32_t i; cJSON *retjson; + char cmd[16384],hexstr[16384],params[32768],*retstr,*rawtx,*pastkeys; int32_t i,numpastkeys; cJSON *retjson; //fprintf(stderr,"rogue_progress num.%d\n",num); if ( rs->guiflag != 0 && Gametxidstr[0] != 0 ) { diff --git a/src/cc/rogue/rogue.c b/src/cc/rogue/rogue.c index 57890207b..478e3d2ed 100644 --- a/src/cc/rogue/rogue.c +++ b/src/cc/rogue/rogue.c @@ -274,18 +274,19 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) { fprintf(stderr,"error reallocating keystrokes\n"); fclose(fp); - return(-1); + return(0); } if ( fread(&keystrokes[num],1,fsize,fp) != fsize ) { fprintf(stderr,"error reading keystrokes from (%s)\n",fname); fclose(fp); - return(-1); + free(keystrokes); + return(0); } fclose(fp); num += fsize; counter++; - fprintf(stderr,"loaded %ld from (%s) total %ld\n",fsize,fname,num); + fprintf(stderr,"loaded %ld from (%s) total %d\n",fsize,fname,num); } *numkeysp = num; return(keystrokes); @@ -293,7 +294,7 @@ char *rogue_keystrokesload(int32_t *numkeysp,uint64_t seed,int32_t counter) int32_t rogue_replay(uint64_t seed,int32_t sleeptime) { - FILE *fp; char fname[1024]; char *keystrokes = 0; long num=0,fsize; int32_t i,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; + FILE *fp; char fname[1024]; char *keystrokes = 0; long fsize; int32_t i,num=0,counter = 0; struct rogue_state *rs; struct rogue_player P,*player = 0; if ( seed == 0 ) seed = 777; keystrokes = rogue_keystrokesload(&num,seed,counter); From 11800949cf914e5158d1ad49f04c3cd5cb1ed61b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 23:57:21 -1100 Subject: [PATCH 05/14] Token fill shouldn't be invalid --- src/cc/rogue_rpc.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index dce56f6a1..e7e809807 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1544,10 +1544,12 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { fprintf(stderr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + if ( enabled != 0 ) + return eval->Invalid("mismatched playerdata"); } if ( funcid == 'H' ) cashout *= 2; - if ( tx.vout.size() > 3 ) // orig of 't' has 0 cashout + if ( tokentx == 0 ) { static char laststr[512]; char cashstr[512]; sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); From e12cf5ad4fa5e88ea7f6793761284aeef3883e32 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 2 Mar 2019 23:58:43 -1100 Subject: [PATCH 06/14] Cache prints --- src/cc/rogue_rpc.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index e7e809807..af1cd9a43 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1541,9 +1541,15 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C // verify pk belongs to this tx if ( playerdata.size() > 0 ) { + static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - fprintf(stderr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + if ( strcmp(laststr,cashstr) != 0 ) + { + strcpy(laststr,cashstr); + fprintf(stderr,"%s\n",cashstr); + } if ( enabled != 0 ) return eval->Invalid("mismatched playerdata"); } @@ -1551,7 +1557,6 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C cashout *= 2; if ( tokentx == 0 ) { - static char laststr[512]; char cashstr[512]; sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { From 66644afe27762540fa96d72f38fabb9e64b94f70 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 00:07:42 -1100 Subject: [PATCH 07/14] Pritns --- src/cc/rogue_rpc.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index af1cd9a43..3318e4dc9 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1544,7 +1544,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - sprintf(cashstr,"ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"tokentx.%d decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); @@ -1555,15 +1555,15 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C } if ( funcid == 'H' ) cashout *= 2; - if ( tokentx == 0 ) + //if ( tokentx == 0 ) { - sprintf(cashstr,"ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + sprintf(cashstr,"tokentx.%d decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); fprintf(stderr,"%s\n",cashstr); } - if ( enabled != 0 && tx.vout[2].nValue != cashout ) + if ( tokentx == 0 && enabled != 0 && tx.vout[2].nValue != cashout ) return eval->Invalid("mismatched cashout amount"); } } From 71fbf19c478ca7afc43a7d6fac501eae7201d6f5 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 00:11:34 -1100 Subject: [PATCH 08/14] Test --- src/cc/rogue_rpc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 3318e4dc9..b690a583e 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1468,7 +1468,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C funcid = script[1]; if ( (e= script[0]) == EVAL_TOKENS ) { - tokentx = 1; + tokentx = funcid; if ( (funcid= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) == 0 ) { if ( (funcid= rogue_registeropretdecode(gametxid,tokenid,playertxid,scriptPubKey)) == 0 ) @@ -1544,7 +1544,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) { - sprintf(cashstr,"tokentx.%d decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d gametxid.%s player.%s invalid playerdata[%d]\n",tokentx,decoded,height,gametxid.GetHex().c_str(),ptxid.GetHex().c_str(),(int32_t)playerdata.size()); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); @@ -1557,7 +1557,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C cashout *= 2; //if ( tokentx == 0 ) { - sprintf(cashstr,"tokentx.%d decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr); From 96d66260fc478925600fc5e1bed3725326d288fa Mon Sep 17 00:00:00 2001 From: Alrighttt <36680730+Alrighttt@users.noreply.github.com> Date: Sun, 3 Mar 2019 13:37:32 +0100 Subject: [PATCH 09/14] remove libboost-dev dep --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d0bc3cf52..0f112982d 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ Komodo is based on Zcash and has been extended by our innovative consensus algor ```shell #The following packages are needed: -sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl libboost-dev +sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget libcurl4-gnutls-dev bsdmainutils automake curl ``` ### Build Komodo From 12b23c595d004423db1217ca87da7c4df10312f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 05:08:09 -1100 Subject: [PATCH 10/14] Remove voutsum overflow check, rely on monotonicity --- src/cc/rogue_rpc.cpp | 2 +- src/main.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index b690a583e..164f50729 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1480,7 +1480,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C if ( e == EVAL_ROGUE ) { //fprintf(stderr,"ht.%d rogue.(%c)\n",height,script[1]); - if ( decoded == 0 ) + //if ( decoded == 0 ) { switch ( funcid ) { diff --git a/src/main.cpp b/src/main.cpp index 8e836ffa0..8ea3a499b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3373,8 +3373,8 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin int64_t nTimeStart = GetTimeMicros(); CAmount nFees = 0; int nInputs = 0; - uint64_t voutsum = 0,prevsum=0,valueout; - int64_t interest,sum = 0; + uint64_t valueout; + int64_t voutsum = 0,prevsum=0,interest,sum = 0; unsigned int nSigOps = 0; CDiskTxPos pos(pindex->GetBlockPos(), GetSizeOfCompactSize(block.vtx.size())); std::vector > vPos; @@ -3501,12 +3501,13 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } prevsum = voutsum; voutsum += valueout; - if ( KOMODO_VALUETOOBIG(voutsum) != 0 ) + /*if ( KOMODO_VALUETOOBIG(voutsum) != 0 ) { fprintf(stderr,"voutsum %.8f too big\n",(double)voutsum/COIN); return state.DoS(100, error("ConnectBlock(): voutsum too big"),REJECT_INVALID,"tx valueout is too big"); } - else if ( voutsum < prevsum ) + else*/ + if ( voutsum < prevsum ) return state.DoS(100, error("ConnectBlock(): voutsum less after adding valueout"),REJECT_INVALID,"tx valueout is too big"); if (!tx.IsCoinBase()) { From e64f0f7bc6cd5d0fbb559a46b835035b20516963 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 05:30:49 -1100 Subject: [PATCH 11/14] 10 billion and 1 --- src/komodo_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/komodo_defs.h b/src/komodo_defs.h index e1b941197..f17e14ebf 100644 --- a/src/komodo_defs.h +++ b/src/komodo_defs.h @@ -36,7 +36,7 @@ #define KOMODO_MAXNVALUE (((uint64_t)1 << 63) - 1) #define KOMODO_BIT63SET(x) ((x) & ((uint64_t)1 << 63)) -#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000000*COIN) +#define KOMODO_VALUETOOBIG(x) ((x) > (uint64_t)10000000001*COIN) extern uint8_t ASSETCHAINS_TXPOW,ASSETCHAINS_PUBLIC; int32_t MAX_BLOCK_SIZE(int32_t height); From 70ac45748f04b54831b6fe564ed91c6c863febc3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 05:54:36 -1100 Subject: [PATCH 12/14] Skip revalidating player data on 't' --- src/cc/rogue_rpc.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index 164f50729..f9a4ba79d 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1480,7 +1480,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C if ( e == EVAL_ROGUE ) { //fprintf(stderr,"ht.%d rogue.(%c)\n",height,script[1]); - //if ( decoded == 0 ) + if ( decoded == 0 ) { switch ( funcid ) { @@ -1523,6 +1523,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C //if ( height > 20000 ) return eval->Invalid("couldnt decode H/Q opret"); } + fprintf(stderr,"height.%d decoded H/Q opret\n",height); // spending the baton proves it is the user if the pk is the signer // rest of validation is done below break; @@ -1538,8 +1539,14 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C return(true); case 'H': // win case 'Q': // bailout + if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid ) + { + //fprintf(stderr,"height.%d couldnt decode H/Q opret\n",height); + //if ( height > 20000 ) + return eval->Invalid("couldnt decode H/Q opret"); + } // verify pk belongs to this tx - if ( playerdata.size() > 0 ) + if ( tokentx != 'c' && playerdata.size() > 0 ) { static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) @@ -1555,17 +1562,14 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C } if ( funcid == 'H' ) cashout *= 2; - //if ( tokentx == 0 ) + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + if ( strcmp(laststr,cashstr) != 0 ) { - sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); - if ( strcmp(laststr,cashstr) != 0 ) - { - strcpy(laststr,cashstr); - fprintf(stderr,"%s\n",cashstr); - } - if ( tokentx == 0 && enabled != 0 && tx.vout[2].nValue != cashout ) - return eval->Invalid("mismatched cashout amount"); + strcpy(laststr,cashstr); + fprintf(stderr,"%s\n",cashstr); } + if ( enabled != 0 && tx.vout[2].nValue != cashout ) + return eval->Invalid("mismatched cashout amount"); } if ( funcid == 'Q' ) { From bbc9c187fb68abeb15abbff2d55c65b26739ffde Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 06:02:51 -1100 Subject: [PATCH 13/14] Check 'c' for valid player data --- src/cc/rogue_rpc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index f9a4ba79d..ce00ef043 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1517,7 +1517,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C return(true); break; case 'H': case 'Q': - if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid ) + /*if ( (f= rogue_highlanderopretdecode(gametxid,tokenid,regslot,pk,playerdata,symbol,pname,scriptPubKey)) != funcid ) { //fprintf(stderr,"height.%d couldnt decode H/Q opret\n",height); //if ( height > 20000 ) @@ -1525,7 +1525,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C } fprintf(stderr,"height.%d decoded H/Q opret\n",height); // spending the baton proves it is the user if the pk is the signer - // rest of validation is done below + // rest of validation is done below*/ break; default: return eval->Invalid("illegal rogue non-decoded funcid"); @@ -1546,7 +1546,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C return eval->Invalid("couldnt decode H/Q opret"); } // verify pk belongs to this tx - if ( tokentx != 'c' && playerdata.size() > 0 ) + if ( tokentx == 'c' && playerdata.size() > 0 ) { static char laststr[512]; char cashstr[512]; if ( rogue_playerdata_validate(&cashout,ptxid,cp,playerdata,gametxid,pk) < 0 ) From c816d2d558ec344e784d479857907eb64f7078ff Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 3 Mar 2019 06:03:23 -1100 Subject: [PATCH 14/14] -print --- src/cc/rogue_rpc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/rogue_rpc.cpp b/src/cc/rogue_rpc.cpp index ce00ef043..bfcdf1f92 100644 --- a/src/cc/rogue_rpc.cpp +++ b/src/cc/rogue_rpc.cpp @@ -1562,7 +1562,7 @@ bool rogue_validate(struct CCcontract_info *cp,int32_t height,Eval *eval,const C } if ( funcid == 'H' ) cashout *= 2; - sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %d,%d %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),tokentx,decoded,(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); + sprintf(cashstr,"tokentx.(%c) decoded.%d ht.%d txid.%s %.8f vs vout2 %.8f",tokentx,decoded,height,txid.GetHex().c_str(),(double)cashout/COIN,(double)tx.vout[2].nValue/COIN); if ( strcmp(laststr,cashstr) != 0 ) { strcpy(laststr,cashstr);