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

Support locked Bitcoin wallets in sidechain manipulation script #44

Closed
wants to merge 6 commits into from

Conversation

droark
Copy link
Contributor

@droark droark commented Aug 3, 2015

As is, the sidechain manipulation script chokes during the "send-to-sidechain" step if the wallet is locked. I've added rudimentary support for unlocking wallets. There are a couple of notes.

  • As written, the user must manually edit the password. I'd prefer to make the password an optional CL parameter. If this is preferential, let me know and I'll go back and edit all files as necessary.
  • While it's doubtful that the script will encounter a pre-0.9 BC Core, the code compensates for the pre-0.9 "wallet already unlocked" error (RPC_WALLET_ALREADY_UNLOCKED) if it's encountered. Any other error kills the script. It's a bit crude but it should work.
  • Is 1000 the default unlock time? I'm happy to change it as necessary. (Perhaps it would be best to use 10 instead?)

Thanks.

As is, the sidechain manipulation script chokes during the "send-to-sidechain" step. I've added rudimentary support for unlocking wallets. There are a couple of notes.

- As written, the user must manually edit the password. I'd prefer to make the password an optional CL parameter. If this is preferential, let me know and I'll go back and edit all files as necessary.
- While it's doubtful that the script will encounter a pre-0.9 BC Core, the code compensates for the pre-0.9 "wallet already unlocked" error (RPC_WALLET_ALREADY_UNLOCKED) if it's encountered. Any other error kills the script. It's a bit crude but it should work.

Thanks.
@droark
Copy link
Contributor Author

droark commented Nov 4, 2015

taps mic Hello?

@TheBlueMatt
Copy link
Contributor

Sure, I dont see why not.

@gwillen
Copy link
Contributor

gwillen commented Nov 5, 2015

Excellent. @droark, want to make it a commandline arg instead of hardcoded, and then we'll merge it? Thanks!

Matt Corallo and others added 4 commits November 5, 2015 12:28
Fix overflow in priority calculation
As is, the sidechain manipulation script chokes during the "send-to-sidechain" step. I've added rudimentary support for unlocking wallets. There are a couple of notes.

- As written, the user must manually edit the password. I'd prefer to make the password an optional CL parameter. If this is preferential, let me know and I'll go back and edit all files as necessary.
- While it's doubtful that the script will encounter a pre-0.9 BC Core, the code compensates for the pre-0.9 "wallet already unlocked" error (RPC_WALLET_ALREADY_UNLOCKED) if it's encountered. Any other error kills the script. It's a bit crude but it should work.

Thanks.
@droark
Copy link
Contributor Author

droark commented Nov 6, 2015

Thanks. I have code and am working on testing. Of course, things have gone a bit sideways (tried to rebase and may have borked the history), so I may end up closing this and trying again.

Also, I ended up following the alpha-README directions and compiled/installed the latest secp256k1. I'm getting the following error. Any ideas? This was before and after I tried a rebase of the alpha code. I'm assuming this has to do with some recent secp256k1 commits I saw and means I'll need to rewind to a few months ago?

droark@ubuntu:~/Projects/PersonalGitRepo/ElementsProject/elements/contrib$ python sidechain-manipulation.py send-to-sidechain 2Mthy8EMKtSXWQmDTKd1Bf676ZJJFkr6VGP 0.1
[libsecp256k1] illegal argument: *outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33 : 65)
Aborted (core dumped)

@gwillen
Copy link
Contributor

gwillen commented Nov 8, 2015

@droark Indeed, take a look at #59 -- apparently an API changed in the meantime. I don't yet know where exactly you need to rewind to, but that is the solution.

@droark
Copy link
Contributor Author

droark commented Nov 9, 2015

Thanks. I got everything rewound properly and can proceed. I'll close this one out and open a new one soon. (Got distracted by life. Blargh.)

@gwillen
Copy link
Contributor

gwillen commented Nov 9, 2015

Not a problem @droark, thanks for still working on this after we let it stall for 3 months. Much appreciated!

@droark
Copy link
Contributor Author

droark commented Nov 9, 2015

Closing this out in favor of a less borked branch and with much more complete code.

@droark droark closed this Nov 9, 2015
@droark droark deleted the patch-1 branch November 9, 2015 19:49
instagibbs added a commit to instagibbs/elements that referenced this pull request Mar 15, 2017
…t-args

elements-tx asset support in outaddr and outscript
jamesdorfman pushed a commit to jamesdorfman/elements that referenced this pull request May 14, 2023
a44caf65fe Merge bitcoin-core/univalue-subtree#28: Import fixes for sanitizer reported issues
135254331e Import fixes for sanitizer reported issues
d5fb86940e refactor: use c++11 range based for loop in checkObject
ff9c379304 refactor: Use nullptr (c++11) instead of NULL
08a99754d5 build: use ax_cxx_compile_stdcxx.m4 to check for C++11 support
66d3713ce7 Merge bitcoin-core/univalue-subtree#29: ci: travis -> cirrus
808d487292 ci: travis -> cirrus
c390ac375f Merge bitcoin-core/univalue-subtree#19: Split sources for easier buildsystem integration
4a5b0a1c65 build: Move source entries out to sources.mk
6c7d94b33c build: cleanup wonky gen usage
a222637c6d Merge ElementsProject#23: Merge changes from jgarzik/univalue@1ae6a23
f77d0f718d Merge commit '1ae6a231a0169938eb3972c1d48dd17cba5947e1' into HEAD
1ae6a231a0 Merge pull request ElementsProject#57 from MarcoFalke/test_fix
92bdd11f0b univalue_write: remove unneeded sstream.h include
ffb621c130 Merge pull request ElementsProject#56 from drodil/remove_sstream_header
f33acf9fe8 Merge commit '7890db9~' into HEAD
66e0adec4d Remove unnecessary sstream header from univalue.h
88967f6586 Version 1.0.4
1dc113dbef Merge pull request ElementsProject#50 from luke-jr/pushKV_bool
72392fb227 [tests] test pushKV for boolean values
c23132bcf4 Pushing boolean value to univalue correctly
81faab26a1 Merge pull request ElementsProject#48 from fwolfst/47-UPDATE_MIT_LINK_TO_HTTPS
b17634ef24 Update URLs to MIT license.
88ab64f6b5 Merge pull request ElementsProject#46 from jasonbcox/master
35ed96da31 Merge pull request ElementsProject#44 from MarcoFalke/Mf1709-univalue-cherrypick-explicit
420c226290 Merge pull request ElementsProject#45 from MarcoFalke/Mf1710-univalue-revert-test

git-subtree-dir: src/univalue
git-subtree-split: a44caf65fe55b9dd8ddb08f04c0f70409efd53b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants