Just a simple nicety in the first blockchain download dialog that abbreviates weeks into months, and months into years. It's not perfect, but it is slightly cleaner.
Update bitcoingui.cpp #3811
pull thegreatnegel wants to merge 5 commits into bitcoin:master from thegreatnegel:patch-1 changing 1 files +12 −2-
thegreatnegel commented at 2:06 AM on March 7, 2014: none
-
1b9f854696
Update bitcoingui.cpp
Just a simple nicety in the first blockchain download dialog that abbreviates weeks into months, and months into years, taking into account the 28 days in February and the extra day from Leap Years. It's not perfect, but it is slightly cleaner.
-
70271a4b39
Update bitcoingui.cpp
Fixed the missing digits, my bad.
-
fe1009b19b
Update bitcoingui.cpp
Fixed the decimal to be a simple int.
-
Update bitcoingui.cpp 8c2c709fc9
-
in src/qt/bitcoingui.cpp:None in 8c2c709fc9 outdated
688 | } 689 | - 690 | + //Set Months in Human Readables 691 | + else if(secs < 52*7*24*60*60) 692 | + { 693 | + timeBehindTxt = tr("%n month(s)","",secs/(30*24*60*60));
laanwj commented at 7:11 AM on March 7, 2014:The average number of seconds in a month, taking into account leap years, is 2629800 (=(365+365+365+366) * 24 * 60 * 60 / 4 / 12)
laanwj commented at 7:15 AM on March 7, 2014: memberThe drawback is that years/months have very large granularity, ie you cannot see progress in the beginning. Months also don't seem to be a good measure of time to me as they vary wildly in length.
What about:
- "%n week(s)" if <=1 year
- "%n year(s) and %n week(s)" if >1year
in src/qt/bitcoingui.cpp:None in 8c2c709fc9 outdated
693 | + timeBehindTxt = tr("%n month(s)","",secs/(30*24*60*60)); 694 | + } 695 | + //Set Years in Human Readables 696 | + else 697 | + { 698 | + timeBehindTxt = tr("%n year(s)","",secs/(52*7*24*60*60));
laanwj commented at 7:19 AM on March 7, 2014:The average number of seconds in a year is closer to (365+365+365+366) * 24 * 60 * 60 / 4 = 31557600 (which is still not entirely precise due to handling of leap years around the centuries, but it's better than just '52 weeks')
thegreatnegel commented at 7:35 AM on March 7, 2014: noneThat's fair, I'll add a more sentient line of code tomorrow to take into account the granularity of months and years (i.e %years == months + years)
c1b9b41422Update bitcoingui.cpp
Appended the Years ++ Months code. Cheers!
BitcoinPullTester commented at 8:09 AM on March 7, 2014: noneAutomatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/c1b9b414228c2d78ee109cdd0d92f4c4a1e8cc37 for binaries and test log.
This could happen for one of several reasons:
- It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts (please tweak those patches in qa/pull-tester)
- It adds/modifies tests which test network rules (thanks for doing that), which conflicts with a patch applied at test time
- It does not build on either Linux i386 or Win32 (via MinGW cross compile)
- The test suite fails on either Linux i386 or Win32
- The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)
If you believe this to be in error, please ping BlueMatt on freenode or TheBlueMatt here.
This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
laanwj commented at 9:05 AM on March 7, 2014: memberI'd still prefer weeks and years, and leaving out the months.
laanwj referenced this in commit a1465ac8e6 on Mar 15, 2014laanwj closed this on Mar 15, 2014thegreatnegel commented at 7:32 AM on March 17, 2014: noneThanks for the update! I was wondering why mine failed the sanity test, I missed updating the qt locales file. Muchos gracias!
On Sat, Mar 15, 2014 at 2:18 AM, Wladimir J. van der Laan < notifications@github.com> wrote:
Reply to this email directly or view it on GitHubhttps://github.com/bitcoin/bitcoin/pull/3811#issuecomment-37721309 .
MathyV referenced this in commit 65894924de on Oct 27, 2014DrahtBot locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 18:16 UTC
More mirrored repositories can be found on mirror.b10c.me