Skip to content

Commit

Permalink
Merge bitcoin#1413: [GUI] Explicit cast from quint32 to bool in filte…
Browse files Browse the repository at this point in the history
…rAcceptsRow

359f70e [GUI] Explicit cast from quint32 to bool in filterAcceptsRow (random-zebra)

Pull request description:

  This is a (hopefully definitive) fix for a strange segfault I was consistently having on testnet with the GUI wallet (during the loading of the stake charts), with the following stacktrace
  ```
  #0  0x00007ffff58363bb in  ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #1  0x00007ffff583b25d in  ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #2  0x00007ffff583b932 in  ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #3  0x00007ffff583bca9 in  ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #4  0x00007ffff583c50a in QSortFilterProxyModel::invalidateFilter() ()
      at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #5  0x00005555556aa809 in DashboardWidget::updateStakeFilter() (this=this@entry=0x5555577817d0) at qt/pivx/dashboardwidget.cpp:480
  #6  0x00005555556ac736 in DashboardWidget::getAmountBy() (this=this@entry=0x5555577817d0) at qt/pivx/dashboardwidget.cpp:503
  #7  0x00005555556ad1a1 in DashboardWidget::loadChartData(bool) (this=this@entry=0x5555577817d0, withMonthNames=false)
      at qt/pivx/dashboardwidget.cpp:556
  #8  0x00005555556ad703 in DashboardWidget::run(int) (this=0x5555577817d0, type=<optimized out>) at qt/pivx/dashboardwidget.cpp:812
  #9  0x00005555557641d4 in Worker::process() (this=0x5555576314c0)
      at qt/pivx/loadingdialog.cpp:12
  #10 0x00007ffff56932b2 in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #11 0x00007ffff569617d in  () at /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
  #12 0x00007ffff4ae36db in start_thread (arg=0x7ffe61ffb700) at pthread_create.c:463
  #13 0x00007ffff2c9e88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  ```

  Explicit the cast to bool when checking the transaction type in `TransactionFilterProxy::filterAcceptsRow`.

ACKs for top commit:
  furszy:
    detective work 👍 , utACK 359f70e.
  Fuzzbawls:
    utACK 359f70e then

Tree-SHA512: f1481a0545fb1ebe62b28232f9257e6c52306ff15dd1dcefc29d4eeb3dd25b7231d48416cad528e720fb68aa192b089e14bfc8ee92e55406ea02fc777f552b15
  • Loading branch information
random-zebra committed Mar 18, 2020
2 parents 0b5fef0 + 359f70e commit 4fdd322
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qt/transactionfilterproxy.cpp
Expand Up @@ -46,7 +46,7 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex&
return false;
if (fHideOrphans && isOrphan(status, type))
return false;
if (!(TYPE(type) & typeFilter))
if (!(bool)(TYPE(type) & typeFilter))
return false;
if (involvesWatchAddress && watchOnlyFilter == WatchOnlyFilter_No)
return false;
Expand Down Expand Up @@ -173,4 +173,4 @@ bool TransactionFilterProxy::isColdStake(int type) const {
QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent);
return index.data(index, role);
}
*/
*/

0 comments on commit 4fdd322

Please sign in to comment.