profile
viewpoint
Pieter Wuille sipa @chaincodelabs @Bitcoin developer at @chaincodelabs. Formerly @Blockstream.

bbuenz/BulletProofLib 133

Library for generating non-interactive zero knowledge proofs without trusted setup (Bulletproofs)

sipa/bips 127

Bitcoin Improvement Proposals

sipa/bech32 123

Code snippets and analysis of the Bech32 format

sipa/bitcoin 65

Bitcoin integration/staging tree

sipa/bitcoin-stats 42

bitcoin.sipa.be scripts

sipa/bitcoin-net-simul 17

Bitcoin network simulator

sipa/ezbase32 9

Simple base32 format with strong error detection

sipa/asmap 6

Compact encoding of approximate prefix->AS table

pull request commentbitcoin/bitcoin

contrib: Parse ELF directly for symbol and security checks

<!--a722867cd34abeea1fadc8d60700f111-->

Gitian builds

File commit e2ff5e7b35d71195278d2a2ed9485f141de33d7a<br>(master) commit 1c4188e0337fc89fa7a72d99d16c7508f97f5497<br>(master and this pull)
bitcoin-core-linux-22-res.yml 44e52af36236879f... ed4680968e93faa5...
bitcoin-core-osx-22-res.yml 71d5fb0e6642d6b0... 127fc6fd6c335c03...
bitcoin-core-win-22-res.yml 0148a2f5e7295184... a56ae5d4153d1349...
*-aarch64-linux-gnu-debug.tar.gz 383e84aaa96f342a... 26fbc2d21bada83d...
*-aarch64-linux-gnu.tar.gz 3558211891c0484a... a35fd2ae3605c54f...
*-arm-linux-gnueabihf-debug.tar.gz 5ebbb475a590480a... 52568603abb0f82d...
*-arm-linux-gnueabihf.tar.gz 60951d893e2688b6... b7c3b23abd9e83d9...
*-osx-unsigned.dmg 7cba6edda598c96c... 56e862ccf0d2b4eb...
*-osx64.tar.gz ea2ab5c893780a2e... ba06f4bfd21a3d07...
*-riscv64-linux-gnu-debug.tar.gz 0c20a43923efcd5f... 500c8c3ec67bcaad...
*-riscv64-linux-gnu.tar.gz 8d3632d81c77eff1... ba164e9b54dbb098...
*-win64-debug.zip 72c35e133cf9a0db... c0afdc8cd087028a...
*-win64-setup-unsigned.exe 55c17bfff54273e5... 3716ec12171f7369...
*-win64.zip f7bf6737c7f741c3... 19e38e38b95c53b1...
*-x86_64-linux-gnu-debug.tar.gz abf91baef5c44686... 03794e9328c8b547...
*-x86_64-linux-gnu.tar.gz 75fda490174df335... ab84f605ba4d0716...
*.tar.gz 793a2c7af39452d5... e07ea56a79dd81a3...
linux-build.log 9c5461a914e1f4c0... 1fbb119f2f0ef4ac...
osx-build.log 5adaf67afbaf00fc... 85dd7dace784a1a6...
win-build.log 756101ecccffabf0... 062b62cf4af16bc9...
bitcoin-core-linux-22-res.yml.diff 2edae2388d844498...
bitcoin-core-osx-22-res.yml.diff f0b350f311f376f3...
bitcoin-core-win-22-res.yml.diff cb6211ee06a2ddc9...
linux-build.log.diff 7b880e3e3f0990cf...
osx-build.log.diff 291601d4a5cea40e...
win-build.log.diff e7b782648941c2c2...
laanwj

comment created time in 5 minutes

pull request commentbitcoin-core/gui

about-view: clean up - Bitcoin Core logo

@hebasto

I ensured that the output is uniform for -version

thanks for the feedback! :)

Screen Shot 2020-11-30 at 11 45 04 PM

RandyMcMillan

comment created time in an hour

pull request commentbitcoin/bitcoin

lint, refactor: Update cppcheck linter to c++17 and improve explicit usage

@fjahr Looks like the fuzzing harnesses needs some massage to compile properly after your fix :)

Thanks, forgot to do that before pushing. Should be ok now.

fjahr

comment created time in 4 hours

pull request commentbitcoin/bitcoin

refactor: replace manual Satoshis-to-BTC conversions with FormatMoney()

Not sure about this. I've been working in #20391 to move the use of COIN (or 1e8) and 1000 from CFeeRate callers all into policy/feerate. This partially does the opposite without removing the other ones, seems less clear next to the btc/kvb line, and brings a dependency.

theStack

comment created time in 5 hours

PR opened bitcoin/bitcoin

refactor: replace manual Satoshis-to-BTC conversions with FormatMoney()

This tiny PR replaces all remaining occurences of manual conversion of Satoshi amounts (CAmount) to a currency unit string via division and modulo operation on COIN (100000000) by the utility function FormatMoney(...). The instances were found with the command

git grep "\%[ ]*COIN"

Only ToString()-functions are affected, but still I'd argue that the constants COIN should only be used:

  • for money constants (like in benchmark/tests, chainparams, GetBlockSubsidy(...) etc.) and
  • for utility functions that need it (like {Parse,Format}Money, ValueFromAmount etc.)

Note that strictly speaking, this is not a pure refactor, as the function FormatMoney(...) drops excess zero after two decimal places.

+4 -2

0 comment

2 changed files

pr created time in 5 hours

pull request commentbitcoin/bitcoin

[tests] Allow outbound & block-relay-only connections in functional tests.

forgot to update- CI is green. this PR is ready for review!

amitiuttarwar

comment created time in 6 hours

pull request commentbitcoin/bitcoin

wallet: introduce setfeerate (an improved settxfee, in sat/vB)

Thanks for the review @MarcoFalke. Dropped the policy/feerate refactoring commit and the FeeModeToBytes commit, changed the new CFeeRate delegating constructor to named constructors, dropped SatsToString in favor of making the existing ToString more flexible, and made ValueFromFeeRate able to work with both sat/b and btc/kb.

jonatack

comment created time in 6 hours

Pull request review commentbitcoin/bitcoin

wallet: introduce setfeerate (an improved settxfee, in sat/vB)

 int ParseSighashString(const UniValue& sighash);  // core_write.cpp UniValue ValueFromAmount(const CAmount& amount);+UniValue ValueFromFeeRate(const CFeeRate& fee_rate);

Updated to allow passing in the fee mode to work with both sat/vB and BTC/kvB

jonatack

comment created time in 6 hours

Pull request review commentbitcoin/bitcoin

wallet: introduce setfeerate (an improved settxfee, in sat/vB)

 BOOST_AUTO_TEST_CASE(GetFeeTest)     CFeeRate(MAX_MONEY, std::numeric_limits<size_t>::max() >> 1).GetFeePerK(); } +BOOST_AUTO_TEST_CASE(CFeeRateConstructorWithUnitsTest)+{+    // Test CFeerate(CAmount fee_rate, FeeEstimatemode mode) constructor+    // ...with BTC/kvB, returns same values as CFeeRate(CAmount fee_rate) ctor+    BOOST_CHECK(CFeeRate(CAmount(-1), FeeEstimateMode::BTC_KVB) == CFeeRate(-1));+    BOOST_CHECK(CFeeRate(CAmount(0), FeeEstimateMode::BTC_KVB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(1), FeeEstimateMode::BTC_KVB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(26), FeeEstimateMode::BTC_KVB) == CFeeRate(26));+    BOOST_CHECK(CFeeRate(CAmount(123), FeeEstimateMode::BTC_KVB) == CFeeRate(123));+    // ...with sat/vB, returns values that are 1e5 smaller+    BOOST_CHECK(CFeeRate(CAmount(-100000), FeeEstimateMode::SAT_VB) == CFeeRate(-1));+    BOOST_CHECK(CFeeRate(CAmount(-99999), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(0), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(99999), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(100000), FeeEstimateMode::SAT_VB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(100001), FeeEstimateMode::SAT_VB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(2690000), FeeEstimateMode::SAT_VB) == CFeeRate(26));+    BOOST_CHECK(CFeeRate(CAmount(123456789), FeeEstimateMode::SAT_VB) == CFeeRate(1234));+    // ...with invalid unit values returns CFeeRate(0)+    BOOST_CHECK(CFeeRate(CAmount{123}, FeeEstimateMode::UNSET) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, std::numeric_limits<size_t>::max()) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, 0) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, -1) == CFeeRate{0});

done, and a leaner implementation, thanks

jonatack

comment created time in 6 hours

Pull request review commentbitcoin/bitcoin

wallet: introduce setfeerate (an improved settxfee, in sat/vB)

 std::string CFeeRate::ToString(const FeeEstimateMode& fee_estimate_mode) const     default:                      return strprintf("%d.%08d %s/kvB", nSatoshisPerK / COIN, nSatoshisPerK % COIN, CURRENCY_UNIT);     } }++std::string CFeeRate::SatsToString() const {

no longer adding this SatsToString() function in favor of making the existing ToString() more flexible

jonatack

comment created time in 6 hours

pull request commentbitcoin/bitcoin

wallet: Error with "Transaction too large" if the funded tx will end up being too large after signing

<!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--174a7506f384e20aa4161008e828411d-->

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #17526 (Use Single Random Draw In addition to knapsack as coin selection fallback by achow101)
  • #17331 (Use effective values throughout coin selection by achow101)
  • #17211 (Allow fundrawtransaction and walletcreatefundedpsbt to take external inputs by achow101)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

achow101

comment created time in 6 hours

Pull request review commentbitcoin/bitcoin

wallet: introduce setfeerate (an improved settxfee, in sat/vB)

 BOOST_AUTO_TEST_CASE(GetFeeTest)     CFeeRate(MAX_MONEY, std::numeric_limits<size_t>::max() >> 1).GetFeePerK(); } +BOOST_AUTO_TEST_CASE(CFeeRateConstructorWithUnitsTest)+{+    // Test CFeerate(CAmount fee_rate, FeeEstimatemode mode) constructor+    // ...with BTC/kvB, returns same values as CFeeRate(CAmount fee_rate) ctor+    BOOST_CHECK(CFeeRate(CAmount(-1), FeeEstimateMode::BTC_KVB) == CFeeRate(-1));+    BOOST_CHECK(CFeeRate(CAmount(0), FeeEstimateMode::BTC_KVB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(1), FeeEstimateMode::BTC_KVB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(26), FeeEstimateMode::BTC_KVB) == CFeeRate(26));+    BOOST_CHECK(CFeeRate(CAmount(123), FeeEstimateMode::BTC_KVB) == CFeeRate(123));+    // ...with sat/vB, returns values that are 1e5 smaller+    BOOST_CHECK(CFeeRate(CAmount(-100000), FeeEstimateMode::SAT_VB) == CFeeRate(-1));+    BOOST_CHECK(CFeeRate(CAmount(-99999), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(0), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(99999), FeeEstimateMode::SAT_VB) == CFeeRate(0));+    BOOST_CHECK(CFeeRate(CAmount(100000), FeeEstimateMode::SAT_VB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(100001), FeeEstimateMode::SAT_VB) == CFeeRate(1));+    BOOST_CHECK(CFeeRate(CAmount(2690000), FeeEstimateMode::SAT_VB) == CFeeRate(26));+    BOOST_CHECK(CFeeRate(CAmount(123456789), FeeEstimateMode::SAT_VB) == CFeeRate(1234));+    // ...with invalid unit values returns CFeeRate(0)+    BOOST_CHECK(CFeeRate(CAmount{123}, FeeEstimateMode::UNSET) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, std::numeric_limits<size_t>::max()) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, 0) == CFeeRate{0});+    BOOST_CHECK(CFeeRate(CAmount{123}, -1) == CFeeRate{0});

Good idea, much better...switching to named constructors.

jonatack

comment created time in 7 hours

pull request commentbitcoin/bitcoin

fuzz: Avoid time-based "non-determinism" in fuzzing harnesses by using mocked GetTime()

@MarcoFalke Oh, I should have clarified that the current patch was written to avoid time-based "non-determinism" without invalidating any seed corpora. Hence the constant.

I agree that if we are okay with invalidating seeds then SetMockTime(ConsumeTime(fuzzed_data_provider)); is obviously the superior choice. (FWIW I'm okay with invalidating seeds for these harnesses.)

I think we still need a constant for the -mocktime parameter passed to BasicTestingSetup though (for InitializeFuzzingContext). Did you have any number in mind that is better than 1? :)

I'll fix SetMockTime(ConsumeTime(fuzzed_data_provider)); and -mocktime=N when we've chosen the most appropriate default :)

practicalswift

comment created time in 7 hours

pull request commentbitcoin/bitcoin

doc: Add instructions on how to fuzz the P2P layer using Honggfuzz NetDriver

@MarcoFalke

Theoretically both types of issues are certainly possible: reproducible (single input enough to trigger condition) and "non-reproducible" (in this context: single input + previous inputs needed to trigger condition).

Practically:

If this fuzzer hits any issues my guess is that such issues will be reproducible with high probability. That has been the case historically with issues uncovered by src/test/fuzz/process_message or src/test/fuzz/process_messages. They have typically not been dependent on a specific state change being cause by previously proceed input.

Does that answer your question? :)

practicalswift

comment created time in 7 hours

PR opened bitcoin/bitcoin

wallet: Error with "Transaction too large" if the funded tx will end up being too large after signing

Currently the Transaction too large is calculated on the transaction that is returned from CreateTransaction. This does not make sense for when CreateTransaction is being used for fundrawtransaction as no signing occurs so the final returned transaction is missing signatures. Thus users may successfully fund a transaction but fail to broadcast it after it has been fully signed.

So instead we should figure out whether the transaction we are funding will be too large after it is signed. We can do this by having CalculateMaximumSignedTxSize also return the transaction weight and then comparing that weight against the maximum weight.

+38 -10

0 comment

4 changed files

pr created time in 8 hours

pull request commentbitcoin/bitcoin

wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping

Disclaimer: @achow101 has walked me throw the PR, I have reviewed it at least twice. I think that the concept makes sense, but I'm not familiar with the wallet code globally and my C++ is somewhat rusty.

achow101

comment created time in 8 hours

pull request commentbitcoin/bitcoin

wallet: Refactor OutputGroups to handle fees and spending eligibility on grouping

Code Review ACK https://github.com/bitcoin/bitcoin/pull/20040/commits/f6b305273910db0e46798d361413a7e878cb45f7

achow101

comment created time in 8 hours

pull request commentbitcoin/bitcoin

build: Bump clang version to fix non-determinism

<!--a722867cd34abeea1fadc8d60700f111-->

Gitian builds

File commit e2ff5e7b35d71195278d2a2ed9485f141de33d7a<br>(master) commit 72cd0fd63573270fda9c57d18a73f3247bef9aff<br>(master and this pull)
bitcoin-core-linux-22-res.yml 44e52af36236879f... e6f1f5a7fe41ba8d...
bitcoin-core-osx-22-res.yml 71d5fb0e6642d6b0...
bitcoin-core-win-22-res.yml 0148a2f5e7295184... 3340ff5a2aec0d24...
*-aarch64-linux-gnu-debug.tar.gz 383e84aaa96f342a... 52bcb378b6890421...
*-aarch64-linux-gnu.tar.gz 3558211891c0484a... 24feb6fcd5fec528...
*-arm-linux-gnueabihf-debug.tar.gz 5ebbb475a590480a... c6e292a5de13eb2f...
*-arm-linux-gnueabihf.tar.gz 60951d893e2688b6... ec001a10f7c1e4d2...
*-osx-unsigned.dmg 7cba6edda598c96c...
*-osx64.tar.gz ea2ab5c893780a2e...
*-riscv64-linux-gnu-debug.tar.gz 0c20a43923efcd5f... 8b0b1c13f71486a0...
*-riscv64-linux-gnu.tar.gz 8d3632d81c77eff1... d23728c8b8b5753c...
*-win64-debug.zip 72c35e133cf9a0db... bf49340f5c31adb2...
*-win64-setup-unsigned.exe 55c17bfff54273e5... 9c8400fef741e6c7...
*-win64.zip f7bf6737c7f741c3... 44697bcfbc2022a1...
*-x86_64-linux-gnu-debug.tar.gz abf91baef5c44686... d2fc2e60636ccf85...
*-x86_64-linux-gnu.tar.gz 75fda490174df335... 6718602375729848...
*.tar.gz 793a2c7af39452d5... 60d0cbf41cfb8fd7...
linux-build.log 9c5461a914e1f4c0... f56f80f61689e4d2...
osx-build.log 5adaf67afbaf00fc... 8f39692c1d4201d0...
win-build.log 756101ecccffabf0... a4819c903f7fe850...
bitcoin-core-linux-22-res.yml.diff 0a171834beadc049...
bitcoin-core-win-22-res.yml.diff 2a6a69da2eae3e32...
linux-build.log.diff 6f0312d91bf6dbb1...
osx-build.log.diff e23831b0cde25e8a...
win-build.log.diff eed6a25578c3fcee...
hebasto

comment created time in 9 hours

PR opened bitcoin/bitcoin

test: Fix intermittent feature_taproot issue

The nodes might disconnect (e.g. due to "Timeout downloading block" https://cirrus-ci.com/task/5313800947630080?command=ci#L1763) and the test fails to continue.

Fix that by reconnecting the nodes.

+5 -0

0 comment

1 changed file

pr created time in 10 hours

pull request commentbitcoin-core/gui

about-view: clean up - Bitcoin Core logo

Updated Screenshots:

Screen Shot 2020-11-30 at 2 37 28 PM Screen Shot 2020-11-30 at 2 37 39 PM

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

                   <enum>Qt::PlainText</enum>                  </property>                  <property name="textInteractionFlags">-                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>+                  <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>                  </property>                 </widget>                </item>-               <item row="4" column="0">-                <widget class="QLabel" name="label_4">+               <item row="16" column="0">+                <widget class="QLabel" name="peersSentLabel">+                 <property name="font">+                  <font>+                   <weight>75</weight>+                   <bold>true</bold>+                  </font>+                 </property>                  <property name="text">-                  <string>Services</string>+                  <string>Sent</string>                  </property>                 </widget>                </item>-               <item row="4" column="1">-                <widget class="QLabel" name="peerServices">+               <item row="0" column="0">+                <widget class="QLabel" name="peerNodeIDLabel">+                 <property name="font">+                  <font>+                   <weight>75</weight>+                   <bold>true</bold>+                  </font>+                 </property>+                 <property name="toolTip">+                  <string>Node ID of Selected Peer</string>+                 </property>+                 <property name="text">+                  <string>Node ID</string>+                 </property>+                </widget>+               </item>+               <item row="6" column="1">+                <widget class="QLabel" name="peerDirection">                  <property name="cursor">                   <cursorShape>IBeamCursor</cursorShape>                  </property>+                 <property name="accessibleName">+                  <string/>+                 </property>

blank

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

             <height>0</height>            </size>           </property>+          <property name="toolTip">+           <string/>+          </property>+          <property name="statusTip">+           <string/>+          </property>+          <property name="whatsThis">+           <string>Peer Detail</string>+          </property>+          <property name="accessibleName">+           <string>Peer Detail</string>+          </property>           <layout class="QVBoxLayout" name="verticalLayout_8">            <item>-            <widget class="QLabel" name="peerHeading">+            <widget class="QScrollArea" name="scrollArea">              <property name="sizePolicy">-              <sizepolicy hsizetype="Preferred" vsizetype="Minimum">+              <sizepolicy hsizetype="Expanding" vsizetype="Expanding">                <horstretch>0</horstretch>                <verstretch>0</verstretch>               </sizepolicy>              </property>-             <property name="minimumSize">-              <size>-               <width>0</width>-               <height>32</height>-              </size>-             </property>              <property name="font">               <font>-               <pointsize>10</pointsize>+               <weight>50</weight>+               <bold>false</bold>               </font>              </property>-             <property name="cursor">-              <cursorShape>IBeamCursor</cursorShape>-             </property>-             <property name="text">-              <string>Select a peer to view detailed information.</string>+             <property name="statusTip">+              <string>Select a Node from List</string>

Where is this visible?

RandyMcMillan

comment created time in 11 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

 QString formatDurationStr(int secs)     return strList.join(" "); } +void sortLocaleAware(QStringList &sList)+{+    std::sort(sList.begin(), sList.end(), [](const QString &s1, const QString &s2){+        return s1.localeAwareCompare(s2) < 0;+    });+}+ QString formatServicesStr(quint64 mask) {     QStringList strList;      for (const auto& flag : serviceFlagsToStr(mask)) {+        if (flag == "NETWORK_LIMITED"){+        strList.append(QString::fromStdString("LIMITED"));+        }+        else+        {         strList.append(QString::fromStdString(flag));+        }+        sortLocaleAware(strList);     }      if (strList.size())-        return strList.join(" & ");+        return strList.join(" ");     else         return QObject::tr("None"); } +QString shortFormatServicesStr(quint64 mask)+{+    QStringList strList;++    for (const auto& flag : serviceFlagsToStr(mask)) {+        if (flag == "NETWORK"){+        strList.append(QString::fromStdString("N"));+        }+        if (flag == "NETWORK_LIMITED"){+        strList.append(QString::fromStdString("L"));+        }+        if (flag == "BLOOM"){+        strList.append(QString::fromStdString("B"));+        }+        if (flag == "WITNESS"){+        strList.append(QString::fromStdString("W"));+        }+        if (flag == "UNKNOWN"){+        strList.append(QString::fromStdString("U"));+        }+        sortLocaleAware(strList);+    }++    if (strList.size())+        return strList.join("");+    else+        return QObject::tr(""); //silence is golden

This conditional seems pointless

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

 QString formatDurationStr(int secs)     return strList.join(" "); } +void sortLocaleAware(QStringList &sList)+{+    std::sort(sList.begin(), sList.end(), [](const QString &s1, const QString &s2){+        return s1.localeAwareCompare(s2) < 0;+    });+}+ QString formatServicesStr(quint64 mask) {     QStringList strList;      for (const auto& flag : serviceFlagsToStr(mask)) {+        if (flag == "NETWORK_LIMITED"){+        strList.append(QString::fromStdString("LIMITED"));

If we're going to start renaming these, "recent-blocks" makes more sense than "LIMITED"...

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

 QString formatDurationStr(int secs)     return strList.join(" "); } +void sortLocaleAware(QStringList &sList)+{+    std::sort(sList.begin(), sList.end(), [](const QString &s1, const QString &s2){+        return s1.localeAwareCompare(s2) < 0;+    });+}+ QString formatServicesStr(quint64 mask) {     QStringList strList;      for (const auto& flag : serviceFlagsToStr(mask)) {+        if (flag == "NETWORK_LIMITED"){+        strList.append(QString::fromStdString("LIMITED"));+        }+        else+        {         strList.append(QString::fromStdString(flag));+        }+        sortLocaleAware(strList);     }      if (strList.size())-        return strList.join(" & ");+        return strList.join(" ");     else         return QObject::tr("None"); } +QString shortFormatServicesStr(quint64 mask)+{+    QStringList strList;++    for (const auto& flag : serviceFlagsToStr(mask)) {

Probably better to re-implement serviceFlagsToStr here...

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

 QString formatDurationStr(int secs)     return strList.join(" "); } +void sortLocaleAware(QStringList &sList)+{+    std::sort(sList.begin(), sList.end(), [](const QString &s1, const QString &s2){+        return s1.localeAwareCompare(s2) < 0;+    });+}+ QString formatServicesStr(quint64 mask) {     QStringList strList;      for (const auto& flag : serviceFlagsToStr(mask)) {+        if (flag == "NETWORK_LIMITED"){+        strList.append(QString::fromStdString("LIMITED"));+        }+        else+        {         strList.append(QString::fromStdString(flag));+        }+        sortLocaleAware(strList);     }      if (strList.size())-        return strList.join(" & ");+        return strList.join(" ");

This seems less clear

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

                   <enum>Qt::PlainText</enum>                  </property>                  <property name="textInteractionFlags">-                  <set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>+                  <set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>                  </property>                 </widget>                </item>-               <item row="8" column="0">-                <widget class="QLabel" name="label_22">+               <item row="12" column="0">+                <widget class="QLabel" name="peerCommonHeightLabel">+                 <property name="font">+                  <font>+                   <weight>75</weight>+                   <bold>true</bold>+                  </font>+                 </property>                  <property name="text">-                  <string>Connection Time</string>+                  <string>Synced Blocks</string>                  </property>                 </widget>                </item>-               <item row="8" column="1">-                <widget class="QLabel" name="peerConnTime">+               <item row="6" column="0">+                <widget class="QLabel" name="peerDirectionLabel">+                 <property name="font">+                  <font>+                   <weight>75</weight>+                   <bold>true</bold>+                  </font>+                 </property>+                 <property name="text">+                  <string>Direction</string>+                 </property>+                </widget>+               </item>+               <item row="20" column="0">+                <widget class="QLabel" name="peerMinPingLabel">+                 <property name="font">+                  <font>+                   <weight>75</weight>+                   <bold>true</bold>+                  </font>+                 </property>+                 <property name="text">+                  <string>Min Ping</string>+                 </property>+                </widget>+               </item>+               <item row="5" column="1">+                <widget class="QLabel" name="peerPermissions">                  <property name="cursor">                   <cursorShape>IBeamCursor</cursorShape>                  </property>+                 <property name="accessibleName">+                  <string/>+                 </property>

blank

RandyMcMillan

comment created time in 10 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

             <height>0</height>            </size>           </property>+          <property name="toolTip">+           <string/>+          </property>+          <property name="statusTip">+           <string/>+          </property>+          <property name="whatsThis">+           <string>Peer Detail</string>+          </property>+          <property name="accessibleName">+           <string>Peer Detail</string>+          </property>           <layout class="QVBoxLayout" name="verticalLayout_8">            <item>-            <widget class="QLabel" name="peerHeading">+            <widget class="QScrollArea" name="scrollArea">              <property name="sizePolicy">-              <sizepolicy hsizetype="Preferred" vsizetype="Minimum">+              <sizepolicy hsizetype="Expanding" vsizetype="Expanding">                <horstretch>0</horstretch>                <verstretch>0</verstretch>               </sizepolicy>              </property>-             <property name="minimumSize">-              <size>-               <width>0</width>-               <height>32</height>-              </size>-             </property>              <property name="font">               <font>-               <pointsize>10</pointsize>+               <weight>50</weight>+               <bold>false</bold>               </font>              </property>-             <property name="cursor">-              <cursorShape>IBeamCursor</cursorShape>-             </property>-             <property name="text">-              <string>Select a peer to view detailed information.</string>+             <property name="statusTip">+              <string>Select a Node from List</string>              </property>-             <property name="alignment">-              <set>Qt::AlignHCenter|Qt::AlignTop</set>+             <property name="whatsThis">+              <string>Detailed Info of Selected Node</string>              </property>

Is this reachable? (Didn't we remove the "What's This" button?)

RandyMcMillan

comment created time in 11 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

             <height>0</height>            </size>           </property>+          <property name="toolTip">+           <string/>+          </property>+          <property name="statusTip">+           <string/>+          </property>+          <property name="whatsThis">+           <string>Peer Detail</string>+          </property>

Not sure this is useful

RandyMcMillan

comment created time in 11 hours

Pull request review commentbitcoin-core/gui

peers-tab: cleaner presentation - more info - functionality improvements

             <height>0</height>            </size>           </property>+          <property name="toolTip">+           <string/>+          </property>+          <property name="statusTip">+           <string/>+          </property>

More pointless code

RandyMcMillan

comment created time in 11 hours

more