Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

An alternative solution to #7729

This adds a clone of the current wallet. The second wallet can be enabled over --enable-lightwallet.

Includes:

  • The cloned wallet is fully protected in its own namespace Lightwallet::.
  • Thanks to the init.cpp refactoring, the intersection between non-wallet classes is extremely minimal (47 lines in init.cpp).
  • Second wallet can run in parallel to the existing one.
  • Accounts are fully removed (including CAccount, CAccountEntry, etc.).
  • Full labels support from rpc: introduce 'label' API for wallet #7729
  • Only one send command (ex sandmany now renamed to "sendcoins")
  • All backward compatibility/version detection and version-backward-comp.-fixes has been removed
  • Version is reset to 10000

Benefits:

  • safe way to remove accounts
  • safe way to add BIP32 and multiwallet support
  • safe way to remove BerkleyDB
  • safe way to slowly process separate the wallet (add SPV)
  • safe way to add a complete new GUI
  • no promise of a stable API until 0.14 or 0.15.

Currently bitcoin-cli misses some value conversion for some commands (you can use cURL for these commands).

This PR is large because of the copy of the content in src/wallet. You can verify the copy by diffing the first commit and start review on top of that**

@instagibbs
Copy link
Member

s/save/safe

@ghost
Copy link

ghost commented Apr 15, 2016

Finally!!!! Great to see it's finally happening.

@maflcko
Copy link
Member

maflcko commented Apr 19, 2016

Instead of copying several thousand lines of code, wouldn't it be possible to avoid that by leaving the current wallet implementation as a base class and then create a derived classes CLegacyWallet() and CLightWallet()? I haven't looked closely at the code, so I don't know if it is feasible, but it's a thought.

static HTTPRPCTimerInterface* httpRPCTimerInterface = 0;

static void JSONErrorReply(HTTPRequest* req, const UniValue& objError, const UniValue& id)
void JSONErrorReply(HTTPRequest* req, const UniValue& objError, const UniValue& id)
Copy link
Member

Choose a reason for hiding this comment

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

Why make this non-static? You're not ever using this outside httprpc (same for RPCAuthorized and HTTPReq_HandleAuth)

@jonasschnelli
Copy link
Contributor Author

Closing for now. Not sure if this is the best solution. Needs discussion on the bitcoin-core-dev mailing list first.

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants