diff --git a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
index 7c15a94c70..02257cd6fe 100644
--- a/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
+++ b/contrib/Installer/GridcoinInstaller/GridcoinResearch.vdproj
@@ -1109,19 +1109,19 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Gridcoin Research"
- "ProductCode" = "8:{63ED5B90-8681-4D08-A77F-D72404912CE5}"
- "PackageCode" = "8:{9605A396-4356-4926-81F1-53F0A704C49B}"
+ "ProductCode" = "8:{EB16F04D-5B36-4513-AFF5-6633C440C80A}"
+ "PackageCode" = "8:{2229A482-65D3-48D5-B16D-A1857C2FAEA9}"
"UpgradeCode" = "8:{9617E9EA-252F-43CE-B53E-B48C85F71192}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:FALSE"
"InstallAllUsers" = "11:TRUE"
- "ProductVersion" = "8:42.6"
+ "ProductVersion" = "8:42.7"
"Manufacturer" = "8:GridcoinResearch"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
- "Title" = "8:Gridcoin Research 42.6"
+ "Title" = "8:Gridcoin Research 42.7"
"Subject" = "8:"
"ARPCONTACT" = "8:The Gridcoin Developers"
"Keywords" = "8:Gridcoin Research"
diff --git a/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb b/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb
index 0493e3a912..326e0cd14d 100644
--- a/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb
+++ b/contrib/Installer/GridcoinRDTestHarness/GridcoinRDTestHarness/Form1.vb
@@ -109,28 +109,34 @@ Public Class Form1
Next
Return sOut
End Function
+
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim sVotes As String = "default_speech_behaviorhttp://www.gridcoin.us12-07-2015 15:36:51BothShould_Gridcoin_Speech_Synthesizer_be_Off_by_Default? Advertising_And_Promotions;General_Development;E-Commerce_Development;Dividend_Reimbursement;New_User_Bonuses;Education_Endowment;On_By_DefaultOff_By_Default00On_By_Default12248281224828On_By_Defaultfavorite_color07-20-2015 15:06:35MagnitudeWhat_Is_Your_Favorite_ColorRed;Green;Blue;Black;Yellow;WhiteRed00Green00Blue00Black00Yellow1604White001604Yellowgender_poll07-04-2015 12:38:19BothAm_I_Male_Or_FemaleMale;FemaleMale00Female11686591168659Female"
sVotes = "catsbarkinghttp://www.gridcoin.us12-07-2015 15:36:51CPID CountDo_Cats_Bark?Yes;No;MaybeYes11No33Maybe0044Nodefault_speech_behavior07-20-2015 15:36:51Magnitude+BalanceShould_Gridcoin_Speech_Synthesizer_be_Off_by_Default?Off_By_Default;On_By_DefaultOff_By_Default610421938On_By_Default311267194921689133On_By_Defaultdogsmeowing07-24-2015 23:20:48ParticipantsDo_Dogs_Meow?Yes;No;MaybeYes11No33Maybe0044Noexpense_authorization_[foundation_blah]08-23-2015 18:25:05Magnitude+BalanceCampaign_1Approve;DenyApprove00Deny0000expense_authorization_[foundation_1B112AFE-F3BC-427F-8F8E-02EE3D951D30]08-23-2015 18:25:37Magnitude+BalanceCampaign_2Approve;DenyApprove00Deny0000favorite_color07-04-2015 15:06:35MagnitudeWhat_Is_Your_Favorite_ColorRed;Green;Blue;Black;Yellow;WhiteRed22739Green25Blue00Black12761Yellow1604White175876867Blackgender_poll07-04-2015 12:38:19Magnitude+BalanceAm_I_Male_Or_FemaleMale;FemaleMale516120616Female22650497718771114Male"
- sVotes = "expense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb]08-03-2016 21:23:59Magnitude+BalanceApprove_Expense?Approve;DenyApprove2271382998Deny002271382998Approveexpense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb];burnamount1-1-1970 00:00:00?0000expense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb];recint1-1-1970 00:00:00?0000expense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff]05-13-2016 22:12:10Magnitude+BalanceApprove_Expense?Approve;DenyApprove1825048422Deny27458242025794246Approveexpense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff];burnamount1-1-1970 00:00:00?0000expense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff];reci1-1-1970 00:00:00?0000expense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4]04-17-2016 12:58:37Magnitude+BalanceApprove_Expense?Approve;DenyApprove1213909185Deny121313909187Approveexpense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4];burnamount1-1-1970 00:00:00?0000expense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4];reci1-1-1970 00:00:00?0000expense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd]04-24-2016 21:46:43Magnitude+BalanceApprove_Expense?Approve;DenyApprove59637923Deny214951279787434Approveexpense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd];burnamount1-1-1970 00:00:00?0000expense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd];reci1-1-1970 00:00:00?0000expense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0]07-29-2016 00:22:44Magnitude+BalanceApprove_Expense?Approve;DenyApprove1845324223Deny11540991945478321Approveexpense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0];burnamount1-1-1970 00:00:00?0000expense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0];reci1-1-1970 00:00:00?0000expense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece]05-27-2016 16:49:45Magnitude+BalanceApprove_Expense?Approve;DenyApprove2236779432Deny212105542437989985Approveexpense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece];burnamount1-1-1970 00:00:00?0000expense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece];reci1-1-1970 00:00:00?0000expense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7]05-27-2016 16:56:36Magnitude+BalanceApprove_Expense?Approve;DenyApprove2033817416Deny111351452134952561Approveexpense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7];burnamount1-1-1970 00:00:00?0000expense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7];reci1-1-1970 00:00:00?0000expense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b]04-25-2016 19:25:35Magnitude+BalanceApprove_Expense?Approve;DenyApprove817134725Deny21495121017284236Approveexpense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b];burnamount1-1-1970 00:00:00?0000expense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b];reci1-1-1970 00:00:00?0000expense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841]05-13-2016 23:41:48Magnitude+BalanceApprove_Expense?Approve;DenyApprove914314303Deny37458681215060171Approveexpense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841];burnamount1-1-1970 00:00:00?0000expense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841];reci1-1-1970 00:00:00?0000expense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf]08-21-2016 17:27:46Magnitude+BalanceApprove_Expense?Approve;DenyApprove1321060967Deny234654091524526376Approveexpense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf];burnamount1-1-1970 00:00:00?0000expense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf];reci1-1-1970 00:00:00?0000new_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330]03-25-2016 13:54:48Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2533959416Deny314184622835377878Approvenew_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330];burnamount1-1-1970 00:00:00?0000new_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330];reci1-1-1970 00:00:00?0000new_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3]05-15-2016 18:09:15Magnitude+BalanceApprove_Campaign?Approve;DenyApprove30101483983Deny315886234761160346330Approvenew_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3];burnamount1-1-1970 00:00:00?0000new_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3];reci1-1-1970 00:00:00?0000new_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb]07-14-2016 10:27:46Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2769031055Deny418997413170930796Approvenew_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb];burnamount1-1-1970 00:00:00?0000new_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb];reci1-1-1970 00:00:00?0000new_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387]03-12-2016 20:30:19Magnitude+BalanceApprove_Campaign?Approve;DenyApprove61331404Deny41332192102663596Denynew_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387];burnamount1-1-1970 00:00:00?0000new_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387];reci1-1-1970 00:00:00?0000new_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40]06-18-2016 19:34:11Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2428305187Deny319152172730220404Approvenew_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40];burnamount1-1-1970 00:00:00?0000new_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40];reci1-1-1970 00:00:00?0000new_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840]07-11-2016 10:55:54Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2452675569Deny14791372553154705Approvenew_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840];burnamount1-1-1970 00:00:00?0000new_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840];reci1-1-1970 00:00:00?0000https://tinyurl.com/znjlu22remove_wuprop_from_whitelist08-16-2016 15:56:22Magnitude+BalanceShould_WuProp_be_removed_from_the_whitelist?yes;noyes74153230978no3022755145104175986123yesremove_wuprop_from_whitelist;burnamount1-1-1970 00:00:00?0000remove_wuprop_from_whitelist;reci1-1-1970 00:00:00?0000https://tinyurl.com/hnffc5kssl_enforcement_poll09-05-2016 16:04:18Magnitude+BalanceShould_SSL_encryption_be_mandatory_for_whitelisted_BOINC_projectsYes;NoYes2222235372No669617622929197134Yesssl_enforcement_poll;burnamount1-1-1970 00:00:00?0000ssl_enforcement_poll;reci1-1-1970 00:00:00?0000https://tinyurl.com/hhqbhorwhat_are_the_best_projects09-05-2016 16:10:44Magnitude+BalanceWhat_are_the_best_projectsYOYO;theSkynetPOGS;SAT;Rosetta;NumberFields;NFS;MindModeling;vLHC;LHC;LeidenClassical;Enigma;Cosmology;ClimatePrediction;YAFU;DistributedDataMining;BURP;CitizenScienceGrid;SETI;PrimeGrid;Einstein;CollatzConjecture;POEM;Milkyway;Asteroids;GPUGRID;WorldCommunityGridYOYO03868333theSkynetPOGS00SAT00Rosetta00NumberFields03868333NFS03868333MindModeling00vLHC00LHC00LeidenClassical00Enigma00Cosmology03868333ClimatePrediction00YAFU03868333DistributedDataMining00BURP00CitizenScienceGrid00SETI00PrimeGrid00Einstein00CollatzConjecture00POEM00Milkyway110428317Asteroids00GPUGRID00WorldCommunityGrid03868333233638316what_are_the_best_projects;burnamount1-1-1970 00:00:00?0000what_are_the_best_projects;reci1-1-1970 00:00:00?0000http://tinyurl.com/zzl6ah9whitelist_bitcoin_utopia05-25-2016 17:17:30Magnitude+BalanceShould_Bitcoin_Utopia_be_included_in_the_project_whitelistYes;NoYes1816013841No6914245082087158464661Nowhitelist_bitcoin_utopia;burnamount1-1-1970 00:00:00?0000whitelist_bitcoin_utopia;reci1-1-1970 00:00:00?0000https://tinyurl.com/zc58ufjcommunication_platform_preference09-05-2016 16:17:40Magnitude+BalanceWhat_communication_platform_do_you_preferTelegram;IRC;Slack;Reddit;Cryptocointalk;Slack;Voat;Whatsapp;Echo;Twitter;Facebook;Bitcointalk;BOINC_Project_Forums;BOINC_Forum;Mumble;Diaspora;Hubzilla;RetroShare;GNU_Social;Movim;OtherTelegram00IRC04641975Slack04641975Reddit210059730Cryptocointalk19856133Slack04641975Voat00Whatsapp00Echo00Twitter04641975Facebook00Bitcointalk00BOINC_Project_Forums00BOINC_Forum00Mumble00Diaspora00Hubzilla00RetroShare00GNU_Social00Movim00Other00338483763Redditcommunication_platform_preference;burnamount1-1-1970 00:00:00?0000communication_platform_preference;reci1-1-1970 00:00:00?0000http://tinyurl.com/hhqot4ewhitelist_denisathome_2016_06_1206-20-2016 04:02:22Magnitude+BalanceShould_DenisatHome_be_included_in_the_project_whitelistYes;NoYes137289002No30418754854349164487Nowhitelist_denisathome_2016_06_12;burnamount1-1-1970 00:00:00?0000whitelist_denisathome_2016_06_12;reci1-1-1970 00:00:00?0000"
+ sVotes = "expense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb]08-03-2016 21:23:59Magnitude+BalanceApprove_Expense?Approve;DenyApprove2271382998Deny002271382998Approveexpense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb];burnamount1-1-1970 00:00:00?0000expense_submissioncoinomi_server_expense_650_usd_per_year[foundation_95592c8f-e06a-4328-88fa-d5895311f8bb];recint1-1-1970 00:00:00?0000expense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff]05-13-2016 22:12:10Magnitude+BalanceApprove_Expense?Approve;DenyApprove1825048422Deny27458242025794246Approveexpense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff];burnamount1-1-1970 00:00:00?0000expense_submissiongoogle_adwords_reimbursement_102.37[foundation_33d7b210-5895-4909-b8a5-b7f6a8a274ff];reci1-1-1970 00:00:00?0000expense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4]04-17-2016 12:58:37Magnitude+BalanceApprove_Expense?Approve;DenyApprove1213909185Deny121313909187Approveexpense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4];burnamount1-1-1970 00:00:00?0000expense_submissiongridcoin_ssl_certificate_+_email_+_domain_renewal[foundation_b93c423d-8989-450f-b608-fb1c409902c4];reci1-1-1970 00:00:00?0000expense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd]04-24-2016 21:46:43Magnitude+BalanceApprove_Expense?Approve;DenyApprove59637923Deny214951279787434Approveexpense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd];burnamount1-1-1970 00:00:00?0000expense_submissiongridcoin_banner_at_boinc_combined[foundation_42ce7e0f-2006-4901-83e6-e97bd3b251cd];reci1-1-1970 00:00:00?0000expense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0]07-29-2016 00:22:44Magnitude+BalanceApprove_Expense?Approve;DenyApprove1845324223Deny11540991945478321Approveexpense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0];burnamount1-1-1970 00:00:00?0000expense_submissionintegration_to_ccedk/openledger_bridge_expense[foundation_48c1e9c6-17e3-4fff-9f2c-9d2945837ed0];reci1-1-1970 00:00:00?0000expense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece]05-27-2016 16:49:45Magnitude+BalanceApprove_Expense?Approve;DenyApprove2236779432Deny212105542437989985Approveexpense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece];burnamount1-1-1970 00:00:00?0000expense_submission_crypto-campaign_on_google_adwords_118.95_usd[foundation_03ee3ae9-58cb-4895-9758-9a62234e7ece];reci1-1-1970 00:00:00?0000expense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7]05-27-2016 16:56:36Magnitude+BalanceApprove_Expense?Approve;DenyApprove2033817416Deny111351452134952561Approveexpense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7];burnamount1-1-1970 00:00:00?0000expense_submission_netsoft_ad_campaign_(second_month)_36.67_usd[foundation_0357c08d-c4e9-451f-be57-b0e01fadf4b7];reci1-1-1970 00:00:00?0000expense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b]04-25-2016 19:25:35Magnitude+BalanceApprove_Expense?Approve;DenyApprove817134725Deny21495121017284236Approveexpense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b];burnamount1-1-1970 00:00:00?0000expense_submission_updated_gridcoin_banner_at_boinc_combined[foundation_7a9eaf9e-ea60-472e-ae99-1f5bc6ba222b];reci1-1-1970 00:00:00?0000expense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841]05-13-2016 23:41:48Magnitude+BalanceApprove_Expense?Approve;DenyApprove914314303Deny37458681215060171Approveexpense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841];burnamount1-1-1970 00:00:00?0000expense_submissiontest[foundation_7230968d-fea8-4004-b4d0-2655ad256841];reci1-1-1970 00:00:00?0000expense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf]08-21-2016 17:27:46Magnitude+BalanceApprove_Expense?Approve;DenyApprove1321060967Deny234654091524526376Approveexpense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf];burnamount1-1-1970 00:00:00?0000expense_submissionuscore_free_promo_grc[foundation_f55a71df-9af4-413c-af12-8e21c0b7d6cf];reci1-1-1970 00:00:00?0000new_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330]03-25-2016 13:54:48Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2533959416Deny314184622835377878Approvenew_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330];burnamount1-1-1970 00:00:00?0000new_campaign_boincstats_advertisement_campaign_-_1_month_top_banner_300_euros[foundation_dd8a0030-983b-44c4-9713-8bd996d3d330];reci1-1-1970 00:00:00?0000new_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3]05-15-2016 18:09:15Magnitude+BalanceApprove_Campaign?Approve;DenyApprove30101483983Deny315886234761160346330Approvenew_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3];burnamount1-1-1970 00:00:00?0000new_campaign_coinomi_gridcoin_integration_expense[foundation_f0352da0-42c8-4ee7-aa75-ef06c6288ef3];reci1-1-1970 00:00:00?0000new_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb]07-14-2016 10:27:46Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2769031055Deny418997413170930796Approvenew_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb];burnamount1-1-1970 00:00:00?0000new_campaign_google_adwords_crypto-websites,_15apr2016-01jul2017,_150_usd_monthly[foundation_7d5f4619-1288-4ad0-aca8-f7b333a85abb];reci1-1-1970 00:00:00?0000new_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387]03-12-2016 20:30:19Magnitude+BalanceApprove_Campaign?Approve;DenyApprove61331404Deny41332192102663596Denynew_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387];burnamount1-1-1970 00:00:00?0000new_campaign_test[foundation_59bb988b-ba79-4258-84e7-2fee68017387];reci1-1-1970 00:00:00?0000new_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40]06-18-2016 19:34:11Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2428305187Deny319152172730220404Approvenew_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40];burnamount1-1-1970 00:00:00?0000new_campaign__netsoft_banner_(1_year)_50_usd_monthly_converted_to_grc[foundation_2054fc1f-ff66-472c-8932-462c88fe9c40];reci1-1-1970 00:00:00?0000new_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840]0-2016 10:55:54Magnitude+BalanceApprove_Campaign?Approve;DenyApprove2452675569Deny14791372553154705Approvenew_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840];burnamount1-1-1970 00:00:00?0000new_campaign__new_boincstats_campaign,_full_month,_300_eur[foundation_57dc3e95-9f5b-4fd8-9074-d3e1e92f2840];reci1-1-1970 00:00:00?0000https://tinyurl.com/znjlu22remove_wuprop_from_whitelist08-16-2016 15:56:22Magnitude+BalanceShould_WuProp_be_removed_from_the_whitelist?yes;noyes74153230978no3022755145104175986123yesremove_wuprop_from_whitelist;burnamount1-1-1970 00:00:00?0000remove_wuprop_from_whitelist;reci1-1-1970 00:00:00?0000https://tinyurl.com/hnffc5kssl_enforcement_poll09-05-2016 16:04:18Magnitude+BalanceShould_SSL_encryption_be_mandatory_for_whitelisted_BOINC_projectsYes;NoYes2222235372No669617622929197134Yesssl_enforcement_poll;burnamount1-1-1970 00:00:00?0000ssl_enforcement_poll;reci1-1-1970 00:00:00?0000https://tinyurl.com/hhqbhorwhat_are_the_best_projects09-05-2016 16:10:44Magnitude+BalanceWhat_are_the_best_projectsYOYO;theSkynetPOGS;SAT;Rosetta;NumberFields;NFS;MindModeling;vLHC;LHC;LeidenClassical;Enigma;Cosmology;ClimatePrediction;YAFU;DistributedDataMining;BURP;CitizenScienceGrid;SETI;PrimeGrid;Einstein;CollatzConjecture;POEM;Milkyway;Asteroids;GPUGRID;WorldCommunityGridYOYO03868333theSkynetPOGS00SAT00Rosetta00NumberFields03868333NFS03868333MindModeling00vLHC00LHC00LeidenClassical00Enigma00Cosmology03868333ClimatePrediction00YAFU03868333DistributedDataMining00BURP00CitizenScienceGrid00SETI00PrimeGrid00Einstein00CollatzConjecture00POEM00Milkyway110428317Asteroids00GPUGRID00WorldCommunityGrid03868333233638316what_are_the_best_projects;burnamount1-1-1970 00:00:00?0000what_are_the_best_projects;reci1-1-1970 00:00:00?0000http://tinyurl.com/zzl6ah9whitelist_bitcoin_utopia05-25-2016 17:17:30Magnitude+BalanceShould_Bitcoin_Utopia_be_included_in_the_project_whitelistYes;NoYes1816013841No6914245082087158464661Nowhitelist_bitcoin_utopia;burnamount1-1-1970 00:00:00?0000whitelist_bitcoin_utopia;reci1-1-1970 00:00:00?0000https://tinyurl.com/zc58ufjcommunication_platform_preference09-05-2016 16:17:40Magnitude+BalanceWhat_communication_platform_do_you_preferTelegram;IRC;Slack;Reddit;Cryptocointalk;Slack;Voat;Whatsapp;Echo;Twitter;Facebook;Bitcointalk;BOINC_Project_Forums;BOINC_Forum;Mumble;Diaspora;Hubzilla;RetroShare;GNU_Social;Movim;OtherTelegram00IRC04641975Slack04641975Reddit210059730Cryptocointalk19856133Slack04641975Voat00Whatsapp00Echo00Twitter04641975Facebook00Bitcointalk00BOINC_Project_Forums00BOINC_Forum00Mumble00Diaspora00Hubzilla00RetroShare00GNU_Social00Movim00Other00338483763Redditcommunication_platform_preference;burnamount1-1-1970 00:00:00?0000communication_platform_preference;reci1-1-1970 00:00:00?0000http://tinyurl.com/hhqot4ewhitelist_denisathome_2016_06_1206-20-2016 04:02:22Magnitude+BalanceShould_DenisatHome_be_included_in_the_project_whitelistYes;NoYes137289002No30418754854349164487Nowhitelist_denisathome_2016_06_12;burnamount1-1-1970 00:00:00?0000whitelist_denisathome_2016_06_12;reci1-1-1970 00:00:00?0000"
' '####### FOR DEBUGGING FOUNDATION EXPENSE APPROVAL SYSTEM #######
' Thread.CurrentThread.CurrentUICulture = New CultureInfo("pt-BR")
' Dim sBin As String = ConvertHexToBin("FFFF")
-
+
mU = New Utilization
- mU.SetDebugMode(True)
+ mU.SetDebugMode(False)
mbTestNet = False
- Dim sTestNet As String = "TESTNET"
- sTestNet = "PROD"
- mU.SetTestNetFlag(sTestNet)
- 'mU.SetGenericVotingData(sVotes)
+ Dim sNet As String = "TESTNET"
+ sNet = "PROD"
+ mU.SetTestNetFlag(sNet)
'mU.ShowVotingConsole()
mU.TestGZIPBoincDownload()
+ 'mU.ExportToCSVFile()
+ Dim sURL As String = "http://csgrid.org/csg/stats/" 'Try it with Citizen Science Group;
+ ' Dim sHash As String = mU.clsGetBoincProjectHash(sURL)
+ ' MsgBox(sHash)
+ Dim sContract As String = mU.GetNeuralContract()
+ Dim sTest As String = sURL + ":1"
Exit Sub
End Sub
diff --git a/contrib/Installer/boinc/boinc/Utilization.vb b/contrib/Installer/boinc/boinc/Utilization.vb
index 2a952f2842..284b9e399d 100644
--- a/contrib/Installer/boinc/boinc/Utilization.vb
+++ b/contrib/Installer/boinc/boinc/Utilization.vb
@@ -14,7 +14,7 @@ Public Class Utilization
Private mlSpeakMagnitude As Double
Public ReadOnly Property Version As Double
Get
- Return 412
+ Return 416
End Get
End Property
@@ -217,6 +217,9 @@ Public Class Utilization
Dim sHash As String = clsQHA.QuorumHashingAlgorithm(sContract)
Return sHash
End Function
+ Public Sub ExportToCSVFile()
+ ExportToCSV2()
+ End Sub
Public Function GetNeuralContract() As String
Dim sContract As String = GetMagnitudeContract()
Return sContract
@@ -509,6 +512,10 @@ Public Class Utilization
ResetCPIDsForManualSync()
Call UpdateMagnitudes()
End Sub
+ Public Function clsGetBoincProjectHash(sURL As String) As String
+ Dim c As New clsBoincProjectDownload
+ Return c.GetBoincProjectHash(sURL)
+ End Function
Public Sub AddressUserThread()
Try
Log("Speaking " + Trim(mlSpeakMagnitude))
diff --git a/contrib/Installer/boinc/boinc/clsBoincProjectDownload.vb b/contrib/Installer/boinc/boinc/clsBoincProjectDownload.vb
index 72624506aa..608fdb3573 100644
--- a/contrib/Installer/boinc/boinc/clsBoincProjectDownload.vb
+++ b/contrib/Installer/boinc/boinc/clsBoincProjectDownload.vb
@@ -31,6 +31,22 @@ Public Class clsBoincProjectDownload
End If
End Try
End Function
+ Public Function RetrieveCacheProjectFilename(sGzipUrl As String) As String
+ Dim sOut As String = Replace(sGzipUrl, "/", "[fslash]")
+ sOut = Replace(sOut, ":", "[colon]")
+ Dim sDayOfYear = Trim(Now.DayOfYear)
+ sOut = Replace(sOut, ".gz", sDayOfYear + "[!]gz")
+ sOut = Replace(sOut, ".", "[period]")
+ sOut = Replace(sOut, "[!]", ".")
+ Return sOut
+ End Function
+ Public Function GetFileAge(sPath As String) As Double
+ If File.Exists(sPath) = False Then Return 1000000
+ Dim fi As New FileInfo(sPath)
+ If fi.Length = 0 Then Return 1000000
+ Dim iMins As Long = DateDiff(DateInterval.Minute, fi.LastWriteTime, Now)
+ Return iMins
+ End Function
Private Function AnalyzeProjectHeader(ByVal sGzipURL As String, ByRef sEtag As String, ByRef sEtagFilePath As String, ByVal sProjectName As String) As Integer
'Output
@@ -41,11 +57,11 @@ Public Class clsBoincProjectDownload
sEtag = dictHeads("ETag")
Dim sTimestamp As String
sTimestamp = dictHeads("Last-Modified")
-
sEtag = Replace(sEtag, Chr(34), "")
sEtag = Replace(sEtag, "W", "")
Dim dStatus As Double = 0
- Dim sGridcoinURL As String = "https://download.gridcoin.us/download/harvest/" + sEtag + ".gz"
+ Dim sGridcoinBaseUrl As String = "https://download.gridcoin.us/download/harvest/"
+ Dim sGridcoinURL As String = sGridcoinBaseUrl + sEtag + ".gz"
Dim dictHeadsGRC As Dictionary(Of String, String) = GetHttpResponseHeaders(sGridcoinURL)
Dim dLength1 As Double = dictHeads("Content-Length")
Dim dLength2 As Double = dictHeadsGRC("Content-Length")
@@ -53,28 +69,31 @@ Public Class clsBoincProjectDownload
Dim bCacheSiteHasSameFile As Boolean = (dLength2 > 0)
Dim sEtagOnFile As String = GetDataValue("etag", "tbetags", sGzipURL).DataColumn1
sEtagFilePath = ConstructTargetFileName(sEtag)
-
- If sEtagOnFile = sEtag Then
+ Dim lAgeInMins As Long = GetFileAge(sEtagFilePath)
+ If sEtagOnFile = sEtag And lAgeInMins < SYNC_THRESHOLD Then
'We already have this file
Return 1
Else
'We do not have this file
- 'Only update Stored Value after we retrieve the file
- Dim sSourceURL As String = IIf(bCacheSiteHasSameFile, sGridcoinURL, sGzipURL)
- Dim bStatus As Boolean = ResilientDownload(sSourceURL, sEtagFilePath, sGzipURL)
+ 'Step 1, see if it exists in our cache before attempting to download from the project site
+ Dim sCacheFileName As String = RetrieveCacheProjectFilename(sGzipURL)
+ Dim bStatus As Boolean = ResilientDownload(sGridcoinBaseUrl + sCacheFileName, sEtagFilePath, sGridcoinBaseUrl + sCacheFileName)
+ If Not bStatus Then
+ Dim sSourceURL As String = IIf(bCacheSiteHasSameFile, sGridcoinURL, sGzipURL)
+ bStatus = ResilientDownload(sSourceURL, sEtagFilePath, sGzipURL)
+ End If
'If all bytes downloaded then store the etag in the local table
+ 'Only update Stored Value after we retrieve the file
If bStatus Then
StoreValue("etag", "tbetags", sGzipURL, sEtag)
StoreValue("etag", "timestamps", sProjectName, sTimestamp)
-
-
+ StoreValue("etag", "tbetag2", sProjectName, sEtag)
'Save the Project Site GZ creation time
Return 2
Else
Return 3
End If
End If
-
End Function
Public Function ResilientDownload(sSourceUrl As String, sEtagFilePath As String, sBackupURL As String) As Boolean
'Doing this just in case we ddos our own website and keep receiving 404 or 500 errors:
@@ -143,6 +162,7 @@ Public Class clsBoincProjectDownload
Dim sTeamEtagFilePath As String = ""
Dim iStatus As Integer = AnalyzeProjectHeader(sTeamGzipURL, sEtag, sTeamEtagFilePath, sProject)
Dim sProjectMasterFileName As String = GetGridFolder() + "NeuralNetwork\" + sProject + ".master.dat"
+ 'store etag by project also
If iStatus <> 1 Or Not File.Exists(sProjectMasterFileName) Then
Try
@@ -179,10 +199,11 @@ Public Class clsBoincProjectDownload
'Scan for the Gridcoin team inside this project:
Dim sTeamPathUnzipped As String = Replace(sTeamEtagFilePath, ".gz", ".xml")
Dim sGzipPathUnzipped As String = Replace(sRacEtagFilePath, ".gz", ".xml")
-
+ Log("Determining Team ID for Project " + sProject + " " + sGzipURL)
Dim lTeamID As Long = GetTeamID(sTeamPathUnzipped)
'Create the project master file
If Not File.Exists(sProjectMasterFileName) Then
+ Log("Emitting Project File for Project " + sProject + " " + sGzipURL)
EmitProjectFile(sGzipPathUnzipped, GetGridFolder() + "NeuralNetwork\", sProject, lTeamID)
End If
Debug.Print(sProject)
@@ -193,7 +214,6 @@ Public Class clsBoincProjectDownload
Next
'Verify all the files exist
-
Dim iTotalProjectsSynced As Integer = 0
'Create master database
Dim sNNFolder As String = GetGridFolder() + "NeuralNetwork\"
@@ -204,12 +224,15 @@ Public Class clsBoincProjectDownload
Dim fi As FileInfo
Dim sProjectLocal As String
msNeuralDetail = "Combining Project Data"
+ Log("Combining Project Data")
+
For Each fi In fiArr
If fi.Name Like "*.master.dat*" Then
sProjectLocal = Replace(fi.Name, ".master.dat", "")
iTotalProjectsSynced += 1
Dim sTimestamp As String = GetDataValue("etag", "timestamps", sProjectLocal).DataColumn1
- Dim dtUTC As DateTime = GetUtcDateTime(CDate(sTimestamp))
+ 'Log the md5 of the master project file so we can determine regional differences
+ Dim iRows As Long = 0
Using oStream As New System.IO.FileStream(fi.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)
Dim objReader As New System.IO.StreamReader(oStream)
While objReader.EndOfStream = False
@@ -219,13 +242,15 @@ Public Class clsBoincProjectDownload
sTemp = Replace(sTemp, "", "" + sProjectLocal + "gridcoin")
sTemp = Replace(sTemp, "", "")
'Dont bother writing timestamps older than 32 days since we base mag off of RAC (Filter RAC based on project header in UTC - RAC Updated UTC - BullShark)
- Dim lRowAgeInMins = GetRowAgeInMins(sTemp, dtUTC)
- If lRowAgeInMins < (60 * 24 * 32) Then
- oSW.WriteLine(sTemp)
- End If
+ iRows += 1
+ oSW.WriteLine(sTemp)
End While
objReader.Close()
End Using
+ Dim sHash As String = GetMd5OfFile(fi.FullName)
+ Dim sEtagOnFile As String = GetDataValue("etag", "tbetag2", sProjectLocal).DataColumn1
+ Dim sOut As String = "*** COMBINING PROJECT FILE " + fi.Name + ", MD5 HASH: " + sHash + ", ROWS: " + Trim(iRows) + ", ETAG: " + sEtagOnFile + " ***"
+ Log(sOut)
End If
Next fi
oSW.Close()
@@ -272,7 +297,78 @@ Public Class clsBoincProjectDownload
swProj.Close()
Return 0
End Function
-
+ Private Function HexStr(iByte As Integer) As String
+ Dim sOut As String = "00" + Hex(iByte)
+ Return sOut.Substring(Len(sOut) - 2, 2)
+ End Function
+ Private Function GetGZChecksum(sURL As String) As String
+ Dim dictHeads As Dictionary(Of String, String) = GetHttpResponseHeaders(sURL)
+ 'Extract the checksum using an HTTP range request
+ Dim request As WebRequest = WebRequest.Create(sURL)
+ Dim hWRQ As HttpWebRequest = CType(request, HttpWebRequest)
+ Dim lStart As Long = Val(dictHeads("Content-Length")) - 8 '2byte magic is in header, 4 byte CRC-32 Checksum is at offset 0 in header, then 4 byte uncompressed data size
+ hWRQ.AddRange(lStart, lStart + 8)
+ Dim response As WebResponse = request.GetResponse
+ Dim dataStream As Stream = response.GetResponseStream()
+ Dim sPath As String = "c:\path.gz"
+ '6a d3 6d cc checksum
+ Dim fs As New FileStream(sPath, FileMode.Create)
+ dataStream.CopyTo(fs)
+ fs.Close()
+ Dim mBytes As Byte() = File.ReadAllBytes(sPath)
+ Dim ckLenBytes(3) As Byte
+ Array.Copy(mBytes, 4, ckLenBytes, 0, 4)
+ Dim sCRC As String = HexStr(mBytes(3)) + HexStr(mBytes(2)) + HexStr(mBytes(1)) + HexStr(mBytes(0))
+ Return sCRC
+ End Function
+ Public Function SlimifyBoincFile(sSourceUserFile As String, sDestUserFile As String, dtSyncTime As DateTime) As Boolean
+ Dim srProj As New StreamReader(sSourceUserFile)
+ Dim swProj As New StreamWriter(sDestUserFile, False)
+ Dim sUser As String = ""
+ While srProj.EndOfStream = False
+ Dim sTemp As String = srProj.ReadLine()
+ sUser += sTemp
+ If (sTemp.Contains("") Or srProj.EndOfStream) Then
+ Dim sCpid As String = ExtractXML(sUser, "")
+ Dim sRac As String = ExtractXML(sUser, "")
+ Dim sTime As String = ExtractXML(sUser, "")
+ 'Dim lAge As Double = GetRowAgeInMins(sUser, dtSyncTime)
+ If Val(sRac) > 10 Then
+ Dim sOut = sCpid + "," + sRac
+ swProj.WriteLine(sOut)
+ End If
+ sUser = ""
+ End If
+ End While
+ srProj.Close()
+ swProj.Close()
+ Return True
+ End Function
+ 'These functions are used to decentralize the Neural Network and therefore in the future it will not be necessary to have a centralized cache for boinc project files on gridcoin.us, but the dev team is still testing these new features currently; They are approximately 50% complete.
+ Public Function GetBoincProjectHash(sBaseURL As String) As String
+ Dim sTeamUrl = sBaseURL + "team.gz"
+ Dim sGzFN As String = GetGridFolder() + "NeuralNetwork\team_temp.gz"
+ Dim bStatus As Boolean = ResilientDownload(sTeamUrl, sGzFN, "")
+ ExtractGZipInnerArchive(sGzFN, GetGridFolder() + "NeuralNetwork\")
+ Dim sTPUZ As String = GetGridFolder() + "NeuralNetwork\" + "team_temp.xml"
+ Dim lTeamID As Long = GetTeamID(sTPUZ)
+ Dim sUserUrl As String = sBaseURL + "user.gz"
+ Dim sUsFn As String = GetGridFolder() + "NeuralNetwork\user_temp.gz"
+ bStatus = ResilientDownload(sUserUrl, sUsFn, "")
+ ExtractGZipInnerArchive(sUsFn, GetGridFolder() + "NeuralNetwork\")
+ Dim sUZ As String = GetGridFolder() + "NeuralNetwork\" + "user_temp.xml"
+ 'Slmify the user file, then gzip it, then get hash
+ Dim sOutFile As String = GetGridFolder() + "NeuralNetwork\" + "slim1.xml"
+ Dim dictHeads As Dictionary(Of String, String) = GetHttpResponseHeaders(sUserUrl)
+ Dim sTimestamp As String = dictHeads("Last-Modified")
+ Dim dtUTC As DateTime = GetUtcDateTime(CDate(sTimestamp))
+ SlimifyBoincFile(sUZ, sOutFile, dtUTC)
+ 'ReGzip this, then return the concatenated GZ hash + MD5 (uncompressed) + GZ Hash
+ Dim sNewGzFile As String = GetGridFolder() + "NeuralNetwork\" + "slim2.gz"
+ CreateGZ(sNewGzFile, sOutFile)
+ Dim sComplexHash As String = "MD5 Component " + " " + "GzComponentHash"
+ Return sComplexHash
+ End Function
Public Function GetTeamID(sPath As String) As Double
Dim swTeam As New StreamReader(sPath)
Dim sChunk As String = ""
@@ -296,7 +392,6 @@ Public Class clsBoincProjectDownload
End If
End While
swTeam.Close()
-
Dim vChunk2() As String
vChunk2 = Split(sChunk, "")
If LCase(sChunk.Contains("gridcoin")) Then
@@ -323,6 +418,16 @@ Public Class clsBoincProjectDownload
End Using
End Using
End Sub
+ Private Sub CreateGZ(gzFilename As String, sourceFile As String)
+ Dim srcFile As System.IO.FileStream = File.OpenRead(sourceFile)
+ Dim zipFile As GZipOutputStream = New GZipOutputStream(File.Open(gzFilename, FileMode.Create))
+ Dim fileData As Byte() = New Byte(srcFile.Length) {}
+ srcFile.Read(fileData, 0, srcFile.Length)
+ zipFile.Write(fileData, 0, fileData.Length)
+ srcFile.Close()
+ zipFile.Close()
+ End Sub
+
Public Sub ExtractZipFile(archiveFilenameIn As String, outFolder As String, bCreateSkeletonDirs As Boolean, bKillOriginal As Boolean)
Dim zf As ZipFile = Nothing
Try
diff --git a/contrib/Installer/boinc/boinc/modPersistedDataSystem.vb b/contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
index 0e60d59843..ac39e8d2c5 100644
--- a/contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
+++ b/contrib/Installer/boinc/boinc/modPersistedDataSystem.vb
@@ -134,6 +134,7 @@ Module modPersistedDataSystem
surrogateRow.Database = "CPID"
surrogateRow.Table = "CPIDS"
Dim lstCPIDs As List(Of Row) = GetList(surrogateRow, "*")
+ 'FAILED TO COMPARE ELEMENT IN ARRAY
lstCPIDs.Sort(Function(x, y) x.PrimaryKey.CompareTo(y.PrimaryKey))
Dim sOut As String = ""
For Each cpid As Row In lstCPIDs
@@ -169,6 +170,9 @@ Module modPersistedDataSystem
Return sData
End If
+ Dim lAgeOfMaster As Long = GetWindowsFileAge(GetGridPath("NeuralNetwork") + "\db.dat")
+ If lAgeOfMaster > PROJECT_SYNC_THRESHOLD Then Return ""
+
Dim surrogateRow As New Row
surrogateRow.Database = "CPID"
surrogateRow.Table = "CPIDS"
@@ -193,17 +197,7 @@ Module modPersistedDataSystem
lRows = lRows + 1
sOut += sRow
dMagAge = 0
- Try
- dMagAge = Math.Abs(DateDiff(DateInterval.Minute, Now, cpid.Added))
-
- Catch ex As Exception
- End Try
-
- If dMagAge > (PROJECT_SYNC_THRESHOLD) Then
- If Not mbDebugging Then Return ""
- End If
-
-
+
Else
Dim sRow As String = cpid.PrimaryKey + ",00;"
lTotal = lTotal + 0
@@ -231,6 +225,7 @@ Module modPersistedDataSystem
If avg < 25 Then Return ""
'APPEND the Averages:
+ Dim lProjectsInContract As Long = 0
Dim surrogateWhitelistRow As New Row
Dim lstWhitelist As List(Of Row)
surrogateWhitelistRow.Database = "Whitelist"
@@ -248,11 +243,18 @@ Module modPersistedDataSystem
Dim sRow As String = r.PrimaryKey + "," + Num(r.AvgRAC) _
+ "," + Num(r.RAC) + ";"
lRows = lRows + 1
+ lProjectsInContract += 1
sOut += sRow
End If
End If
Next
+ Log("Contracts in Project : " + Trim(lProjectsInContract) + ", Whitelisted Count: " + lstP.Count.ToString())
+
+ If (lProjectsInContract < lstP.Count * 0.5) Then
+ Log("Not enough projects in contract.")
+ Return ""
+ End If
sOut += "NeuralNetwork,2000000,20000000;"
sOut += ""
Return sOut
@@ -381,11 +383,11 @@ Module modPersistedDataSystem
End Try
End Function
Public Sub SyncDPOR2()
- If Math.Abs(DateDiff(DateInterval.Second, Now, mdLastSync)) > 60 * 10 Then bMagsDoneLoading = True
- If bMagsDoneLoading = False Then
- Log("Blocked call.")
- Exit Sub
- End If
+ ' If Math.Abs(DateDiff(DateInterval.Second, Now, mdLastSync)) > 60 * 10 Then bMagsDoneLoading = True
+ ' If bMagsDoneLoading = False Then
+ 'Log("Blocked call.")
+ 'Exit Sub
+ 'End If
If KeyValue("disableneuralnetwork") = "true" Then
Log("Neural network is disabled.")
Exit Sub
@@ -430,7 +432,7 @@ Module modPersistedDataSystem
SoftKill(sPath + "*team.xml")
End Sub
Private Sub ClearWhitelistData()
- Dim sPath As String = GetGridFolder() + "NeuralNetwork\"
+ Dim sPath As String = GetGridFolder() + "NeuralNetwork\Whitelist\"
SoftKill(sPath + "whitelist*.dat")
End Sub
Public Function EnsureNNDirExists()
@@ -604,7 +606,7 @@ Module modPersistedDataSystem
Log("Unable to create neural network directory.")
End Try
End If
- Kill(sNN + sDatabase + "*.dat")
+ Kill(sNN + sDatabase + "\*.dat")
Catch ex As Exception
Log("EraseNeuralNetwork:" + ex.Message)
End Try
@@ -667,7 +669,8 @@ Module modPersistedDataSystem
surrogateRow1.Database = "CPID"
surrogateRow1.Table = "CPIDS"
EraseNeuralNetwork("cpid")
-
+ EraseNeuralNetwork("cpids")
+
For x As Integer = 0 To UBound(vCPIDs)
If Len(vCPIDs(x)) > 20 Then
Dim vRow() As String
@@ -1006,7 +1009,8 @@ Module modPersistedDataSystem
Dim d As String = ""
Dim x As New List(Of Row)
Dim oLock As New Object
- Dim sNNFolder As String = GetGridFolder() + "NeuralNetwork\"
+
+ Dim sNNFolder As String = GetGridFolder() + "NeuralNetwork\" + DataRow.Table + "\"
Dim bBlacklist As Boolean
SyncLock oLock
@@ -1030,7 +1034,11 @@ Module modPersistedDataSystem
r.PrimaryKey = Replace(r.PrimaryKey, "_", " ")
If IsInListExact(r.PrimaryKey, x) Then bBlacklist = True
End If
- If Not bBlacklist Then x.Add(r)
+ If Not bBlacklist Then
+ If Not r.PrimaryKey Is Nothing Then
+ x.Add(r)
+ End If
+ End If
End If
End While
objReader.Close()
@@ -1256,10 +1264,6 @@ Retry:
CPID.Table = "CPIDS"
CPID.Magnitude = Trim(Math.Round(Magnitude, 2))
Store(CPID)
- Try
- ' If bGenData Then mGRCData.VoteOnMagnitude(CPID.PrimaryKey, Magnitude, mbTestNet)
- Catch ex As Exception
- End Try
End Function
Private Function PersistProjectRAC(sCPID As String, rac As Double, Project As String, bGenData As Boolean) As Boolean
'Store the CPID_PROJECT RAC:
@@ -1311,7 +1315,12 @@ Retry:
vDate = Split(s, "/")
Dim dtOut As Date = CDate("1-1-1900")
If UBound(vDate) >= 5 Then
- dtOut = New Date(Val(vDate(0)), Val(vDate(1)), Val(vDate(2)), Val(vDate(3)), Val(vDate(4)), Val(vDate(5)))
+ Try
+ dtOut = New Date(Val(vDate(0)), Val(vDate(1)), Val(vDate(2)), Val(vDate(3)), Val(vDate(4)), Val(vDate(5)))
+
+ Catch ex As Exception
+ Return CDate("1-1-1900")
+ End Try
End If
Return dtOut
End Function
@@ -1422,6 +1431,7 @@ Retry:
Dim bFound As Boolean
If dataRow.Added = New Date Then dataRow.Added = Now
SyncLock oLock
+ 'FileMode.Create
Dim oFileOutStream As New System.IO.FileStream(sPath, FileMode.Create, FileAccess.Write, FileShare.ReadWrite)
Using objWriter As New System.IO.StreamWriter(oFileOutStream)
objWriter.WriteLine(SerializeRow(dataRow))
@@ -1446,7 +1456,7 @@ Retry:
Public Function GetPath(dataRow As Row) As String
Dim sFilename As String = LCase(dataRow.Database) + "_" + LCase(dataRow.Table) + ".dat"
- Dim sPath As String = GetGridFolder() + "NeuralNetwork\"
+ Dim sPath As String = GetGridFolder() + "NeuralNetwork\" + dataRow.Table + "\"
If Not System.IO.Directory.Exists(sPath) Then
Try
MkDir(sPath)
@@ -1459,9 +1469,16 @@ Retry:
End Function
Public Function GetEntryName(dataRow As Row, sPrimaryKey As String) As String
Dim sFilename As String = LCase(dataRow.Database) + "_" + LCase(dataRow.Table) + "_" + sPrimaryKey + ".dat"
- Dim sPath As String = GetGridFolder() + "NeuralNetwork\"
+ Dim sPath As String = GetGridFolder() + "NeuralNetwork\" + dataRow.Table + "\"
+ Try
+ If Not System.IO.Directory.Exists(sPath) Then MkDir(sPath)
+ Catch ex As Exception
+ Log("Unable to create folder " + sPath)
+ End Try
+
Return sPath + sFilename
End Function
+
Public Function GetEntryPrefix(dataRow As Row) As String
Dim sFilename As String = LCase(dataRow.Database) + "_" + LCase(dataRow.Table) + "_"
Return sFilename
@@ -1715,10 +1732,18 @@ Retry:
Dim iMins As Long = DateDiff(DateInterval.Minute, fi.LastWriteTime, Now)
Return iMins
End Function
- Public Function GetUtcDateTime(dtTime As DateTime) As DateTime
+ Public Function GetUtcDateTime(sDateTime As String) As DateTime
'When converting from a date time to a target datetime that falls within the window of a daylight savings time adjustment, an error is thrown since the target is technically no longer a valid date time, so we need to account for this just in case
'On July2nd 2017, the Western Sahara had a 2AM to 3AM local time change and an error was thrown when we pulled in a RAC timestamp of 2AM JUL 2 2017 and tried to convert it to UTC
'Step 1, try the natural conversion first
+ If sDateTime = "" Then Return CDate("1-1-1970")
+ Dim dtTime As DateTime = CDate("1-1-1970")
+ Try
+ dtTime = CDate(sDateTime)
+ Catch ex As Exception
+ Log("Error while converting #" + Trim(sDateTime) + " to DateTime")
+ Return CDate("1-1-1970")
+ End Try
Try
Dim dTime As DateTime = TimeZoneInfo.ConvertTimeToUtc(dtTime)
Return dTime
@@ -1742,6 +1767,9 @@ Retry:
Dim iMins As Long = DateDiff(DateInterval.Minute, dTime, dtSyncTime)
Return iMins
End Function
+
+
+
Public Function GetUnixFileAge(sPath As String) As Double
If File.Exists(sPath) = False Then Return 1000000
Dim fi As New FileInfo(sPath)
@@ -1760,7 +1788,7 @@ Retry:
sr.Close()
Log("GUFA Timestamp: " + Trim(dMaxStamp))
Dim dTime As DateTime = UnixTimestampToDate(dMaxStamp)
- Dim iMins As Long = DateDiff(DateInterval.Minute, dTime, Now)
+ Dim iMins As Long = DateDiff(DateInterval.Minute, dTime, DateTime.UtcNow)
Return iMins
End Function
Public Function GetQuorumHash(data As String)
diff --git a/src/clientversion.h b/src/clientversion.h
index e3d3e25eb8..e8863f3be5 100644
--- a/src/clientversion.h
+++ b/src/clientversion.h
@@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 3
#define CLIENT_VERSION_MINOR 5
#define CLIENT_VERSION_REVISION 9
-#define CLIENT_VERSION_BUILD 2
+#define CLIENT_VERSION_BUILD 3
// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
diff --git a/src/main.cpp b/src/main.cpp
index 73517880fb..bae35735a6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -93,7 +93,7 @@ extern bool BlockNeedsChecked(int64_t BlockTime);
extern void FixInvalidResearchTotals(std::vector vDisconnect, std::vector vConnect);
int64_t GetEarliestWalletTransaction();
extern void IncrementVersionCount(const std::string& Version);
-double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_avg,bool bIgnoreBeacons);
+double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_avg,bool bIgnoreBeacons, int nHeight);
extern bool LoadAdminMessages(bool bFullTableScan,std::string& out_errors);
extern bool UnusualActivityReport();
@@ -4357,7 +4357,7 @@ bool VerifySuperblock(std::string superblock, int nHeight)
double avg_mag = 0;
if (superblock.length() > 20)
{
- avg_mag = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,false);
+ avg_mag = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,false,nHeight);
bPassed=true;
if (!IsResearchAgeEnabled(nHeight))
{
@@ -4366,7 +4366,8 @@ bool VerifySuperblock(std::string superblock, int nHeight)
// New rules added here:
if (out_avg < 10 && fTestNet) bPassed = false;
if (out_avg < 70 && !fTestNet) bPassed = false;
- if (avg_mag < 10) bPassed = false;
+ if (avg_mag < 10 && !fTestNet) bPassed = false;
+ // Verify distinct project count matches whitelist
}
if (fDebug3 && !bPassed)
{
@@ -4383,6 +4384,12 @@ bool NeedASuperblock()
if (superblock.length() > 20 && !OutOfSyncByAge())
{
if (!VerifySuperblock(superblock,pindexBest->nHeight)) bDireNeedOfSuperblock = true;
+ /*
+ // Check project count in last superblock
+ double out_project_count = 0;
+ double out_whitelist_count = 0;
+ GetSuperblockProjectCount(superblock, out_project_count, out_whitelist_count);
+ */
}
int64_t superblock_age = GetAdjustedTime() - mvApplicationCacheTimestamp["superblock;magnitudes"];
if ((double)superblock_age > (double)(GetSuperblockAgeSpacing(nBestHeight))) bDireNeedOfSuperblock = true;
@@ -4500,13 +4507,13 @@ void GridcoinServices()
{
if ((nBestHeight % 3) == 0)
{
- if (fDebug3) printf("#CNNSH# ");
+ if (fDebug10) printf("#CNNSH# ");
ComputeNeuralNetworkSupermajorityHashes();
UpdateNeuralNetworkQuorumData();
}
if ((nBestHeight % 20) == 0)
{
- if (fDebug3) printf("#TIB# ");
+ if (fDebug10) printf("#TIB# ");
bDoTally = true;
}
}
@@ -8808,7 +8815,7 @@ bool MemorizeMessage(std::string msg, int64_t nTime, double dAmount, std::string
std::string out_address = "";
std::string out_publickey = "";
GetBeaconElements(sMessageValue, out_cpid, out_address, out_publickey);
- if (fDebug3 && LessVerbose(50))
+ if (fDebug10 && LessVerbose(50))
{
printf("\r\n**Beacon Debug Message : beaconpubkey %s, message key %s, cpid %s, addr %s, base64 pub key %s \r\n ",sBPK.c_str(),
sMessageKey.c_str(),out_cpid.c_str(),out_address.c_str(), out_publickey.c_str());
diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp
index fbbcdbba2c..5c1db67a36 100755
--- a/src/rpcblockchain.cpp
+++ b/src/rpcblockchain.cpp
@@ -89,7 +89,7 @@ extern bool AdvertiseBeacon(bool bFromService, std::string &sOutPrivKey, std::st
double Round(double d, int place);
bool UnusualActivityReport();
double GetCountOf(std::string datatype);
-extern double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_average, bool bIgnoreBeacons);
+extern double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_average, bool bIgnoreBeacons,int nHeight);
extern bool CPIDAcidTest2(std::string bpk, std::string externalcpid);
bool AsyncNeuralRequest(std::string command_name,std::string cpid,int NodeLimit);
@@ -969,7 +969,18 @@ double GetSuperblockMagnitudeByCPID(std::string data, std::string cpid)
return -1;
}
-double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_average, bool bIgnoreBeacons)
+
+void GetSuperblockProjectCount(std::string data, double& out_project_count, double& out_whitelist_count)
+{
+ // This is reserved in case we ever want to resync prematurely when the last superblock contains < .75% of whitelisted projects (remember we allow superblocks with up to .50% of the whitelisted projects, in case some project sites are being ddossed)
+ std::string avgs = ExtractXML(data,"","");
+ double avg_of_projects = GetAverageInList(avgs, out_project_count);
+ out_whitelist_count = GetCountOf("project");
+ if (fDebug10) printf(" GSPC:CountOfProjInBlock %f vs WhitelistedCount %f \r\n",(double)out_project_count,(double)out_whitelist_count);
+}
+
+
+double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out_participant_count,double& out_average, bool bIgnoreBeacons,int nHeight)
{
try
{
@@ -981,12 +992,16 @@ double GetSuperblockAvgMag(std::string data,double& out_beacon_count,double& out
double avg_of_magnitudes = GetAverageInList(mags,mag_count);
double avg_of_projects = GetAverageInList(avgs,avg_count);
if (!bIgnoreBeacons) out_beacon_count = GetCountOf("beacon");
+ double out_project_count = GetCountOf("project");
out_participant_count = mag_count;
out_average = avg_of_magnitudes;
if (avg_of_magnitudes < 000010) return -1;
if (avg_of_magnitudes > 170000) return -2;
if (avg_of_projects < 050000) return -3;
+ // Note bIgnoreBeacons is passed in when the chain is syncing from 0 (this is because the lists of beacons and projects are not full at that point)
if (!fTestNet && !bIgnoreBeacons && (mag_count < out_beacon_count*.90 || mag_count > out_beacon_count*1.10)) return -4;
+ if (fDebug10) printf(" CountOfProjInBlock %f vs WhitelistedCount %f Height %f \r\n",(double)avg_count,(double)out_project_count,(double)nHeight);
+ if (!fTestNet && !bIgnoreBeacons && nHeight > 972000 && (avg_count < out_project_count*.50)) return -5;
return avg_of_magnitudes + avg_of_projects;
}
catch (std::exception &e)
@@ -3015,7 +3030,7 @@ Value execute(const Array& params, bool fHelp)
double out_beacon_count = 0;
double out_participant_count = 0;
double out_avg = 0;
- double avg = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,false);
+ double avg = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,false,nBestHeight);
entry.push_back(Pair("avg",avg));
entry.push_back(Pair("beacon_count",out_beacon_count));
entry.push_back(Pair("beacon_participant_count",out_participant_count));
@@ -3037,7 +3052,7 @@ Value execute(const Array& params, bool fHelp)
double out_beacon_count = 0;
double out_participant_count = 0;
double out_avg = 0;
- double avg = GetSuperblockAvgMag(contract,out_beacon_count,out_participant_count,out_avg,false);
+ double avg = GetSuperblockAvgMag(contract,out_beacon_count,out_participant_count,out_avg,false,nBestHeight);
bool bValid = VerifySuperblock(contract,pindexBest->nHeight);
entry.push_back(Pair("avg",avg));
entry.push_back(Pair("beacon_count",out_beacon_count));
@@ -3492,7 +3507,7 @@ Array SuperblockReport(std::string cpid)
double out_avg = 0;
// Binary Support 12-20-2015
std::string superblock = UnpackBinarySuperblock(bb.superblock);
- double avg_mag = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,true);
+ double avg_mag = GetSuperblockAvgMag(superblock,out_beacon_count,out_participant_count,out_avg,true,pblockindex->nHeight);
if (avg_mag > 10)
{
Object c;