Skip to content

Conversation

Diapolo
Copy link

@Diapolo Diapolo commented Jan 8, 2013

  • add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound()
    require the list to be in ascending order (see
    http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)
  • add a new check in AddressTableModel::setData() to just return, when no
    changes were made to a label or an address (prevents entry duplication
    issue)
  • remove "rec->label = value.toString();" from
    AddressTableModel::setData() as the label gets updated by
    AddressTablePriv::updateEntry() anyway (seems @sipa added this line via
    1025440#L6R225)
  • add another new check in AddressTableModel::setData() to just return, if
    a duplicate address was found (prevents address overwrite)
  • add a new check to EditAddressDialog::setModel() to prevent setting an
    invalid model
  • re-work the switch-case statement in AddressTableModel::accept() to
    always break (as return get's called anyway) and order the list to match
    the enum definition
  • make accept() in editaddressdialog.h a public slot, which it should be
  • misc small coding style changes

Intended to fix: #2137 and #1839.

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED BUILD/TEST, see http://jenkins.bluematt.me/pull-tester/ae1c11d44a4ea90001ea777883cc2cef8a60c846 for binaries and test log.

This could happen for one of several reasons:

  1. It chanages paths in makefile.linux-mingw or otherwise changes build scripts in a way that made them incompatible with the automated testing scripts
  2. It does not build on either Linux i386 or Win32 (via MinGW cross compile)
  3. The test suite fails on either Linux i386 or Win32
  4. The block test-cases failed (lookup the first bNN identifier which failed in https://github.com/TheBlueMatt/test-scripts/blob/master/FullBlockTestGenerator.java)

@Diapolo
Copy link
Author

Diapolo commented Jan 8, 2013

@TheBlueMatt Can you fix @BitcoinPullTester?
fatal error: error writing to /tmp/ccBCY0YL.s: No space left on device

@laanwj
Copy link
Member

laanwj commented Jan 8, 2013

Cool

btw:
add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound() require the list to be in ascending order (see http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)

Are you sure this is needed? It should already stay in sorted order by picking the insertion positions carefully

@Diapolo
Copy link
Author

Diapolo commented Jan 8, 2013

@laanwj Take a look here, the unsorted list caused some weird issues for me.

qSort

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/ae1c11d44a4ea90001ea777883cc2cef8a60c846 for binaries and test log.

@Diapolo
Copy link
Author

Diapolo commented Jan 9, 2013

I consider this a rather important bugfix and would love to see it in 0.8. I'll try to get some bug-reporters, to test this.

@@ -342,9 +361,8 @@ QString AddressTableModel::addRow(const QString &type, const QString &label, con
strAddress = CBitcoinAddress(newKey.GetID()).ToString();
}
else
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't do this. I prefer explicit {} around blocks, as it prevents a class of bugs when a statement is added.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I reverted this one.

Edit: Do you have any clue, why my Firefox refuses to display Commits and Files Changed on Github? I'm getting crazy because of this...

Edit 2: Crazy, I had dom.storage.enabled set to false, which prevents Github page from working correctly!

- add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound()
  require the list to be in ascending order (see
  http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)
- add a new check in AddressTableModel::setData() to just return, when no
  changes were made to a label or an address (prevents entry duplication
  issue)
- remove "rec->label = value.toString();" from
  AddressTableModel::setData() as the label gets updated by
  AddressTablePriv::updateEntry() anyway (seems @sipa added this line via
  1025440#L6R225)
- add another new check in AddressTableModel::setData() to just return, if
  a duplicate address was found (prevents address overwrite)
- add a new check to EditAddressDialog::setModel() to prevent setting an
  invalid model
- re-work the switch-case statement in AddressTableModel::accept() to
  always break (as return get's called anyway) and order the list to match
  the enum definition
- make accept() in editaddressdialog.h a public slot, which it should be
- misc small coding style changes
@laanwj
Copy link
Member

laanwj commented Jan 9, 2013

Code changes are OK, but if some people can confirm that this solves their bug that'd be great :)

@BitcoinPullTester
Copy link

Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/e6d230056202b05a27f187dff2648eb5c76fcfee for binaries and test log.

@Diapolo
Copy link
Author

Diapolo commented Jan 11, 2013

@laanwj Take a look at #1839, it seems this indeed fixes the problem.

@Diapolo
Copy link
Author

Diapolo commented Jan 17, 2013

@laanwj ping² :-P

laanwj added a commit that referenced this pull request Jan 19, 2013
Bitcoin-Qt: fix known addressbook bugs
@laanwj laanwj merged commit bd85cf3 into bitcoin:master Jan 19, 2013
laudney pushed a commit to reddcoin-project/reddcoin-3.10 that referenced this pull request Mar 19, 2014
Bitcoin-Qt: fix known addressbook bugs
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Jul 2, 2018
…itcoin#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Jul 2, 2018
…itcoin#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
HashUnlimited pushed a commit to HashUnlimited/chaincoin that referenced this pull request Jul 3, 2018
…itcoin#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 6, 2018
…itcoin#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
owlhooter pushed a commit to owlhooter/mazacoin-new that referenced this pull request Oct 11, 2018
…itcoin#2157)

Messages should be serialized according the protocol of the peer who asked us or otherwise peers running on other protocols won't be able to deserialize the message correctly.
guruvan added a commit to guruvan/maza that referenced this pull request Nov 8, 2018
* MAZA-POS: (5575 commits)
  Mazafication of code More mazafication More mazafications and compile correction fixes fix for build issues fix for build issues fix string in net.cpp correct pow.cpp correct validation.cpp fixing for build errors fix typo Merge remote-tracking branch 'origin/MAZA-POS' into MAZA-POS
  merge to dash rebase
  Release notes 0.12.3.3
  Remove redundant parameter fCheckDuplicateInputs from CheckTransaction
  Fix crash bug with duplicate inputs within a transaction
  Bump to 0.12.3.3
  Release notes 0.12.3.2 (bitcoin#2174)
  Add tests for special rules for slow blocks on devnet/testnet (bitcoin#2176)
  Allow mining min diff for very slow (2h+) blocks (bitcoin#2175)
  Fix issues with selections on Masternode tab (bitcoin#2170)
  Sync mn list and mnw list from 3 peers max (bitcoin#2169)
  A few devnet related fixes (bitcoin#2168)
  Adjust diff for slow testnet/devnet blocks a bit smoother (bitcoin#2161)
  Make PS Buttons not react to spacebar (bitcoin#2154)
  Bump to 0.12.3.2 (bitcoin#2173)
  Bump to 0.12.3.1 (bitcoin#2158)
  Update release notes (bitcoin#2155)
  Use correct protocol when serializing messages in reply to `getdata` (bitcoin#2157)
  Fix p2pkh tests asserts (bitcoin#2153)
  Fix block value/payee validation in lite mode (bitcoin#2148)
  ...
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Editing label single address in address book also changes another label
3 participants