Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet encapsulation: TODOs, and make SetAddress and GetAccountAddress into methods of CWallet #2075

Closed
wants to merge 49 commits into from

Conversation

mikegogulski
Copy link

@sipa: Looking more sensible now without the JSON dependencies.

@BitcoinPullTester
Copy link

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

@BitcoinPullTester
Copy link

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

@mikegogulski
Copy link
Author

Thanks for the review, Diapolo. Latest commit closes all of that except the pass-by-reference question you posed.

@BitcoinPullTester
Copy link

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

@BitcoinPullTester
Copy link

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

@BitcoinPullTester
Copy link

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

@BitcoinPullTester
Copy link

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

@BitcoinPullTester
Copy link

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

@CodeShark
Copy link
Contributor

Nice effort. The Wallet interface could certainly use cleaning up.

I would like to eventually merge this with #2124 and #2121

@mikegogulski
Copy link
Author

Thanks. I'm going to leave some comments over there.

@sipa
Copy link
Member

sipa commented Dec 25, 2012

Looks good in general. Instead of comments in the code about what is supposed to be done, I'd rather see a commit that actually does it. On the other hand, this is probably easier to explain what you're about to do, and get comments without actually coding it.

One nit: I don't like the wallet code depending on base58 encoding stuff (it's inevitable in some places because of backward compatibility with the wallet format on disk, but still try to avoid it)... so can you return a CTxDestination instead of a CBitcoinAddress from CWallet methods?

@mikegogulski
Copy link
Author

Hi Pieter, thanks for the feedback. Tagging @CodeShark here too.

I laid off on turning comments into code simply for want of more feedback. Not too much sense in plowing ahead with a raft of changes which will get rejected for reasons I hadn't anticipated.

I think your nit is a serious issue, actually. Just as the json stuff should be kept out of the wallet representation as much as possible, so the base58 stuff as well.

@@ -513,6 +398,7 @@ Value getbalance(const Array& params, bool fHelp)
nMinDepth = params[1].get_int();

if (params[0].get_str() == "*") {
// TODO: Why is there a "different way" if both "should always return the same number"?
Copy link
Member

Choose a reason for hiding this comment

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

That's not really a TODO, is it? The reason there are two ways is explained below. One calculates the credits and debits to/from an account (or all accounts), the other just counts the unspent outputs left.

Copy link
Author

Choose a reason for hiding this comment

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

No, not a TODO, more of a note-to-myself: "figure this out, fool!" :)

I'll snip it out of my next commit. Working on CTxDestination instead of CBitcoinAddress now.

@BitcoinPullTester
Copy link

Automatic sanity-testing: FAILED MERGE, see http://jenkins.bluematt.me/pull-tester/c7b1086d9f79722a7f4749cd0b924dff708b3c3a for test log.

This pull does not merge cleanly onto current master

roques and others added 4 commits December 26, 2012 15:12
Use shifts instead of going through the MPI representation of BIGNUMs.
Be careful to keep the meaning of 0x00800000 as sign bit.
With a change of libs, and specifying NATIVE_WINDOWS as TARGET_OS it should compile libleveldb.a and libmemenv.a just fine, it did for me and Diapolo when testing.
  feature in clang.  These macros should primarily be used to
  document which locks protect a given piece of data.  Secondary it
  can be used to document the set of held and excluded locks when
  entering a function.
redshark1802 and others added 21 commits December 26, 2012 15:17
- use it for displaying URI parsing warnings
- use it for displaying error and information in backup wallet function
  (the information display is new and the error was a warning before)

- cleanup BitcoinGUI::incomingTransaction()
-- use message() + the information icon from message
-- comment out an unused parameter in the function definition and
   declaration
-- move all pre-checks at the beginning of the function
- remove unused parameter from ThreadSafeAskFee(), which also results in
  the removal of an orphan translation-string
With MinGW we use .a not .lib
- even if we are allowed to fail pre-allocating, it's better to check
  for sufficient space before calling AllocateFileRange() and if we
  are out of disk space return with error()
- the above change allows us to remove the CheckDiskSpace() check
  in CBlock::AcceptBlock()
This problem is like earth (mostly harmless). After/during a
-reindex, it means the statistics about the last block file
reported in debug.log are always of blk00000.dat instead of the
last file. Apart from that, it means a few more database entries
need to be read when finding a file to append to the first time.
When the coin database is out of date with the block database, the
best block in it is automatically switched to. This reconnection
process can take time, so allow it to be interrupted.

This also stops block connection as soon as shutdown is requested,
leading to a faster shutdown.
- to be able to see threadsafety.h in the Qt Creator IDE the file needs to
  be added to the HEADERS section
Break one long comment down into 3 lines so it's readable.
@mikegogulski
Copy link
Author

something tells me i've failed to do my first rebasing properly. Anyone got an education link that applies to this project's workflow?

@Diapolo
Copy link

Diapolo commented Dec 26, 2012

To which branch did you intend to rebase?

To rebase to current master I normaly do this:
git fetch upstream -p
git rebase upstream
git push origin %BRANCHNAME% -f

@mikegogulski
Copy link
Author

Closing this down in favor of #2130

@sipa
Copy link
Member

sipa commented Dec 26, 2012

You know you can push to a branch that is already pull-requested, to have the pull request updated?

@mikegogulski
Copy link
Author

mumble I guess. I'm not over the learning curve in using git yet, by any means. In this case I wanted to rebase cleanly onto bitcoin/bitcoin, screwed it up here, so decided to try fresh on the new branch walletencap3.

HashUnlimited pushed a commit to chaincoin/chaincoin that referenced this pull request Jun 4, 2018
Activates via SPORK_6_NEW_SIGS to avoid nInputCount malleability
@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.

None yet