From a382d91a3511fae91b5b30bfd57f5e5d47daff05 Mon Sep 17 00:00:00 2001 From: Git Date: Sat, 31 Aug 2013 08:00:54 +0000 Subject: [PATCH] Empty commit --- sections/forums/main.php | 2 +- sections/tools/data/bitcoin_unproc.php | 66 ++++++++++++++++++++++++++ sections/tools/index.php | 7 +++ sections/tools/tools.php | 3 +- 4 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 sections/tools/data/bitcoin_unproc.php diff --git a/sections/forums/main.php b/sections/forums/main.php index 9048d691..2cd48712 100644 --- a/sections/forums/main.php +++ b/sections/forums/main.php @@ -67,7 +67,7 @@ - + diff --git a/sections/tools/data/bitcoin_unproc.php b/sections/tools/data/bitcoin_unproc.php new file mode 100644 index 00000000..eb7a54d9 --- /dev/null +++ b/sections/tools/data/bitcoin_unproc.php @@ -0,0 +1,66 @@ +query(" + SELECT BitcoinAddress, SUM(Amount) + FROM donations_bitcoin + GROUP BY BitcoinAddress"); +$OldDonations = G::$DB->to_pair(0, 1, false); +?> +
+
+

Unprocessed Bitcoin donations

+
+
+
Do not process these donations manually! The bitcoin parser will get them sooner or later (poke a developer if something seems broken).
+
+ + + + + + + + + + $Amount) { + if (isset($OldDonations[$Address])) { + if ($Amount == $OldDonations[$Address]) { // Direct comparison should be fine as everything comes from bitcoind + continue; + } + $Debug->log_var(array('old' => $OldDonations[$Address], 'new' => $Amount), "New donations from $Address"); + // PHP doesn't do fixed-point math, and json_decode has already botched the precision + // so let's just round this off to satoshis and pray that we're on a 64 bit system + $Amount = round($Amount - $OldDonations[$Address], 8); + } + $NewDonations[$Address] = $Amount; +} +if (!empty($NewDonations)) { + foreach(DonationsBitcoin::get_userids(array_keys($NewDonations)) as $Address => $UserID) { +?> + + + + + + + + + + + + + +
Bitcoin addressUserUnprocessed amountTotal amountDonor rankSpecial rank
No unprocessed Bitcoin donations
+
+Data Donation log - Bitcoin donation balance + Bitcoin donations (balance) + Bitcoin donations (unprocessed) Registration log