From 44d1fac8574ff9e4b63081d602ddc5323dd72e31 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Mar 2019 03:10:10 -1100 Subject: [PATCH 1/5] Maketetris --- src/cc/maketetris | 2 ++ 1 file changed, 2 insertions(+) create mode 100755 src/cc/maketetris diff --git a/src/cc/maketetris b/src/cc/maketetris new file mode 100755 index 000000000..9c2a005a0 --- /dev/null +++ b/src/cc/maketetris @@ -0,0 +1,2 @@ +gcc -O3 -std=c++11 -I../secp256k1/include -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -DSTANDALONE tetris.cpp -lncurses -o tetris + From 0ed77a852c33ab9056ef0625665fa8b34d5b5f27 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Mar 2019 21:46:19 -1100 Subject: [PATCH 2/5] Slow down clock --- src/cc/tetris.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/tetris.cpp b/src/cc/tetris.cpp index 254c9b135..40278d493 100644 --- a/src/cc/tetris.cpp +++ b/src/cc/tetris.cpp @@ -867,7 +867,7 @@ int main(int argc, char **argv) display_piece(hold, tg->stored); display_score(score, tg); doupdate(); - sleep_milli(10); + sleep_milli(50); switch (getch()) { case KEY_LEFT: From 5e44e6d33ec4ef262f360ce9bcd883640e2ab5f7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Mar 2019 21:47:51 -1100 Subject: [PATCH 3/5] Faster and slower --- src/cc/tetris.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cc/tetris.cpp b/src/cc/tetris.cpp index 40278d493..41e8c1a78 100644 --- a/src/cc/tetris.cpp +++ b/src/cc/tetris.cpp @@ -858,7 +858,7 @@ int main(int argc, char **argv) next = newwin(6, 10, 0, 2 * (tg->cols + 1) + 1); hold = newwin(6, 10, 7, 2 * (tg->cols + 1) + 1); score = newwin(6, 10, 14, 2 * (tg->cols + 1 ) + 1); - + int32_t counter = 0; // Game loop while (running) { running = tg_tick(tg, move); @@ -866,8 +866,9 @@ int main(int argc, char **argv) display_piece(next, tg->next); display_piece(hold, tg->stored); display_score(score, tg); - doupdate(); - sleep_milli(50); + if ( (counter++ & 1) == 0 ) + doupdate(); + sleep_milli(25); switch (getch()) { case KEY_LEFT: From 6ef61a1aa9de6902245f8a030e6fc5d09c15de3c Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 7 Mar 2019 21:50:30 -1100 Subject: [PATCH 4/5] A0/50 --- src/cc/tetris.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/tetris.cpp b/src/cc/tetris.cpp index 41e8c1a78..d6ae473fe 100644 --- a/src/cc/tetris.cpp +++ b/src/cc/tetris.cpp @@ -866,9 +866,9 @@ int main(int argc, char **argv) display_piece(next, tg->next); display_piece(hold, tg->stored); display_score(score, tg); - if ( (counter++ & 1) == 0 ) + if ( (counter++ % 5) == 0 ) doupdate(); - sleep_milli(25); + sleep_milli(10); switch (getch()) { case KEY_LEFT: From 21c8a023e70703c4d31be9ca0279f28a43c3f4de Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Mar 2019 22:54:02 -1100 Subject: [PATCH 5/5] Fix dilithium inputs scan to compare for the voutpubtxids[vout] --- src/cc/dilithium.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc/dilithium.c b/src/cc/dilithium.c index d4b75bf38..7ab6b4c37 100644 --- a/src/cc/dilithium.c +++ b/src/cc/dilithium.c @@ -3352,7 +3352,7 @@ int64_t dilithium_inputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPu { if ( (nValue= IsCClibvout(cp,vintx,vout,cmpaddr)) > DILITHIUM_TXFEE && myIsutxo_spentinmempool(ignoretxid,ignorevin,txid,vout) == 0 ) { - if ( (dilithium_Qsendopretdecode(checktxid,tmpsig,voutpubtxids,vintx.vout[numvouts-1].scriptPubKey) == 'Q' || dilithium_sendopretdecode(checktxid,vintx.vout[numvouts-1].scriptPubKey) == 'x') && destpubtxid == checktxid ) + if ( (dilithium_Qsendopretdecode(checktxid,tmpsig,voutpubtxids,vintx.vout[numvouts-1].scriptPubKey) == 'Q' && vout < voutpubtxids.size() && checktxid == voutpubtxids[vout]) || (dilithium_sendopretdecode(checktxid,vintx.vout[numvouts-1].scriptPubKey) == 'x' && destpubtxid == checktxid) ) { if ( total != 0 && maxinputs != 0 ) mtx.vin.push_back(CTxIn(txid,vout,CScript()));