From 5acd8f603910aa759c2e35ef217fd69b85200a8a Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Fri, 25 Aug 2017 16:16:39 +0100 Subject: [PATCH 01/11] reduced number of blocksync threads to 2 --- cron/blockstuff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cron/blockstuff.php b/cron/blockstuff.php index 6fa78cf..e9ef3d1 100644 --- a/cron/blockstuff.php +++ b/cron/blockstuff.php @@ -64,7 +64,7 @@ class BlockStuff { $stmt->execute([]); $max_block = $stmt->fetch(PDO::FETCH_OBJ); if ($max_block) { - $chunk_limit = 10; + $chunk_limit = 2; $curr_height = 0; $chunks = floor($max_block->Height / $chunk_limit); $threads = []; From 66940ac02a659dba71e49a7d44accb7384eff553 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sun, 27 Aug 2017 13:50:03 +0000 Subject: [PATCH 02/11] cron script modification for lbrycrd blocknotify --- cron/blocks.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cron/blocks.sh b/cron/blocks.sh index dc5c788..2a2b7b5 100755 --- a/cron/blocks.sh +++ b/cron/blocks.sh @@ -1,4 +1,7 @@ #!/bin/sh cd /var/www/lbry.block.ng bin/cake block parsenewblocks +rm tmp/lock/parsenewblocks +bin/cake block parsetxs +rm tmp/lock/parsetxs From a19e3abd07d1d087064c096c97a91843921c734b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Tue, 5 Sep 2017 09:46:31 +0100 Subject: [PATCH 03/11] forevermempool fix --- src/Shell/BlockShell.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Shell/BlockShell.php b/src/Shell/BlockShell.php index 2c933de..6202095 100644 --- a/src/Shell/BlockShell.php +++ b/src/Shell/BlockShell.php @@ -1298,7 +1298,11 @@ class BlockShell extends Shell { } } } catch (\Exception $e) { - echo "Error occurred processing mempool: " . $e->getMessage() . "\n"; + echo "Mempool database error. Attempting to reconnect.\n"; + + // Final fix for MySQL server has gone away (hopefully) + $conn->disconnect(); + $conn->connect(); } echo "*******************\n"; From 7f701f87d500d3e437cbb9b1a8559189571453d2 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 9 Oct 2017 09:07:38 +0100 Subject: [PATCH 04/11] removed some unused code --- src/Shell/BlockShell.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Shell/BlockShell.php b/src/Shell/BlockShell.php index 6202095..fcb0c59 100644 --- a/src/Shell/BlockShell.php +++ b/src/Shell/BlockShell.php @@ -35,11 +35,6 @@ class BlockShell extends Shell { $this->out('No arguments specified'); } - public function testtx() { - $raw = '0100000001e4801fa8c9621753410e6c576c73168cc551624e08e4cc56e9a9189e8ebabcc3010000006b483045022100dcc5ae5564353e05cd8415936cdb534a26049a80a9866dbcab5dbb6ab16abbc702203af681fb5fbba5c78af887778aa32f27bc653312322b44c2a78e883e322921790121031c38def6b103b58481818d7d8aba39f9f51798f686ec3332bac23726a23366adffffffff0200e1f50500000000fd3a01b512626c6f636b6578706c6f7265722d686f6d654d0801080110011aa3010801125c080410011a1c4c42525920426c6f636b204578706c6f72657220486f6d6570616765222c574950204c42525920426c6f636b204578706c6f72657220686f6d6520706167652073637265656e73686f742a00320038004a0052005a001a41080110011a3038c6bf4a310d5b172aaae03cffb93e5a27c47f3946f58af0a4b9f99d7be42998f7dcec9b0fb0c124a6477bdb4c5311db2209696d6167652f706e672a5c080110031a401eb69f65768ba2cc347067dfb1317131137f7d685a5e804a4aeedd2385332c70f3ec7632fcebfbc073e37a58dbfbf4e6641853bbfc188b0d8bf27435b540801d22146b2a1d378efcdb7db7a03baa7dfedb86b976bc4a6d7576a914b7182b0f7c896ab240d233f81cb891e3f25e739988ac8085e811000000001976a9146fde27b4dac0b79a9ea06756562a52b019da7a8e88ac00000000'; - $decoded = self::decode_tx($raw); - } - public function fixscripthashtx() { $conn = ConnectionManager::get('default'); $otxs = $this->Outputs->find()->select(['TransactionId'])->distinct(['TransactionId'])->where(['Type' => 'scripthash'])->toArray(); From 85926e316f22906c60ee40a28f967dccfd9bcf58 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 14 Aug 2017 20:58:13 +0100 Subject: [PATCH 05/11] price changed to display N/A when the value is $0.00 --- src/Controller/MainController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index 52af76f..c585fd4 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -77,7 +77,7 @@ class MainController extends AppController { } } - $lbcUsdPrice = isset($priceInfo->price) ? '$' . $priceInfo->price : 'N/A'; + $lbcUsdPrice = (isset($priceInfo->price) && ($priceInfo->price > 0)) ? '$' . $priceInfo->price : 'N/A'; return $lbcUsdPrice; } From 1d9dbb802bbc80483343c9038c5fefdd8f4fd9e6 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 14 Aug 2017 21:02:12 +0100 Subject: [PATCH 06/11] fix zero price on homepage --- src/Controller/MainController.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Controller/MainController.php b/src/Controller/MainController.php index c585fd4..efc2036 100644 --- a/src/Controller/MainController.php +++ b/src/Controller/MainController.php @@ -53,7 +53,7 @@ class MainController extends AppController { $lastPriceDt = new \DateTime($priceInfo->time); $diff = $now->diff($lastPriceDt); $diffMinutes = $diff->i; - if ($diffMinutes >= 15) { // 15 minutes + if ($diffMinutes >= 15 || $priceInfo->price == 0) { // 15 minutes (or if the price is 0) $shouldRefreshPrice = true; } } @@ -68,10 +68,12 @@ class MainController extends AppController { $lbcPrice = 0; if (isset($blckjson->USD)) { $lbcPrice = $onelbc * $blckjson->USD->buy; - $priceInfo->price = number_format($lbcPrice, 2, '.', ''); - $priceInfo->time = $now->format('c'); - if ($this->redis) { - $this->redis->set(self::lbcPriceKey, json_encode($priceInfo)); + if ($lbcPrice > 0) { + $priceInfo->price = number_format($lbcPrice, 2, '.', ''); + $priceInfo->time = $now->format('c'); + if ($this->redis) { + $this->redis->set(self::lbcPriceKey, json_encode($priceInfo)); + } } } } From e7e444f84afc7d3a02fdfa7065c5e002e558e59b Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Wed, 16 Aug 2017 17:59:13 +0100 Subject: [PATCH 07/11] some updates from the explorer.lbry.io branch --- src/Template/Layout/default.ctp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 0352a67..54c4239 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -34,6 +34,30 @@ +<<<<<<< HEAD +======= + + +>>>>>>> 04802c3... removed unnecessary alert fetch('meta') ?> fetch('css') ?> fetch('script') ?> From ba995ed51fac6693aa3e45a5adf247d90bb3d242 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Mon, 9 Oct 2017 13:33:39 +0100 Subject: [PATCH 08/11] fix code merge issues --- src/Template/Layout/default.ctp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/Template/Layout/default.ctp b/src/Template/Layout/default.ctp index 54c4239..0352a67 100644 --- a/src/Template/Layout/default.ctp +++ b/src/Template/Layout/default.ctp @@ -34,30 +34,6 @@ -<<<<<<< HEAD -======= - - ->>>>>>> 04802c3... removed unnecessary alert fetch('meta') ?> fetch('css') ?> fetch('script') ?> From 6e6dcd06131c424c33c777e32f8e5cbbb84fff43 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 26 Aug 2017 14:27:57 +0100 Subject: [PATCH 09/11] added created time and block time to transction details page --- src/Template/Main/tx.ctp | 27 +++++++++++++++++++++++++++ webroot/css/main.css | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/src/Template/Main/tx.ctp b/src/Template/Main/tx.ctp index 6277392..e306b45 100644 --- a/src/Template/Main/tx.ctp +++ b/src/Template/Main/tx.ctp @@ -17,6 +17,33 @@

Hash ?>

+
+
+

Time Created

+
Created->format('j M Y H:i:s') . ' UTC '; ?>
+
+ +
+

Block Time

+
TransactionTime == null || strlen(trim($tx->TransactionTime)) == 0) ? 'Not yet confirmed' : + \DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?> + + TransactionTime > $tx->Created->getTimestamp()): + $diffSeconds = $tx->TransactionTime - $tx->Created->Timestamp(); + if ($diffSeconds <= 60) { + echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's'); + } else { + $diffMinutes = ceil($diffSeconds / 60); + echo sprintf(' (+%s minute%s)', $diffMinutes, $diffMinutes == 1 ? '' : 's'); + } + ?> + +
+
+ +
+
+
Amount (LBC)
diff --git a/webroot/css/main.css b/webroot/css/main.css index 79ccec4..c97c83c 100644 --- a/webroot/css/main.css +++ b/webroot/css/main.css @@ -195,6 +195,10 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi .tx-head h3 { font-size: 200%; margin-bottom: 3px } .tx-head h4 { font-size: 125% } +.tx-time { width: 1200px; margin: 0 auto 32px auto; font-weight: 300 } +.tx-time h3 { font-size: 105%; margin: 0; margin-bottom: 4px; font-weight: normal; cursor: help; border-bottom: 1px dotted #999; display: inline-block } +.tx-time .created-time, .tx-time .conf-time { float: left; width: 25% } + .realtime-head { width: 1200px; margin: 0 auto 36px auto; cursor: default } .realtime-head h3 { font-weight: 300; margin: 0; font-size: 200% } .realtime-main { width: 1200px; margin: 0 auto 0 auto } From 409a0a7da7d67f242046f71dcc4ec250329a8680 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 26 Aug 2017 14:31:44 +0100 Subject: [PATCH 10/11] fixed getTimestamp error --- src/Template/Main/tx.ctp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Template/Main/tx.ctp b/src/Template/Main/tx.ctp index e306b45..59805b0 100644 --- a/src/Template/Main/tx.ctp +++ b/src/Template/Main/tx.ctp @@ -29,7 +29,7 @@ \DateTime::createFromFormat('U', $tx->TransactionTime)->format('j M Y H:i:s') . ' UTC' ?> TransactionTime > $tx->Created->getTimestamp()): - $diffSeconds = $tx->TransactionTime - $tx->Created->Timestamp(); + $diffSeconds = $tx->TransactionTime - $tx->Created->getTimestamp(); if ($diffSeconds <= 60) { echo sprintf(' (+%s second%s)', $diffSeconds, $diffSeconds == 1 ? '' : 's'); } else { From 58620a62985474bacb4733b609401076335b0b87 Mon Sep 17 00:00:00 2001 From: Akinwale Ariwodola Date: Sat, 26 Aug 2017 14:33:47 +0100 Subject: [PATCH 11/11] updated transaction time css --- webroot/css/main.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webroot/css/main.css b/webroot/css/main.css index c97c83c..3f4b3b0 100644 --- a/webroot/css/main.css +++ b/webroot/css/main.css @@ -197,7 +197,7 @@ footer .content .page-time { position: absolute; right: 12px; bottom: 0px; paddi .tx-time { width: 1200px; margin: 0 auto 32px auto; font-weight: 300 } .tx-time h3 { font-size: 105%; margin: 0; margin-bottom: 4px; font-weight: normal; cursor: help; border-bottom: 1px dotted #999; display: inline-block } -.tx-time .created-time, .tx-time .conf-time { float: left; width: 25% } +.tx-time .created-time, .tx-time .conf-time { float: left; width: 33% } .realtime-head { width: 1200px; margin: 0 auto 36px auto; cursor: default } .realtime-head h3 { font-weight: 300; margin: 0; font-size: 200% }