elements icon indicating copy to clipboard operation
elements copied to clipboard

[Post -0.21] Runing createwallet on a node should anyonecanspendismine it should rescan by default

Open sanket1729 opened this issue 3 years ago • 2 comments

With initialfreecoins and anyonecanspend in elements.conf, we should rescan the wallets for looking for anyonecanspend outputs.

Pre 0.21, this is not an issue because whenever the default wallet was created, it autoscanned the blockchain looking for anyonecanspend outputs. But since 0.21, there is no default wallet creation and using createwallet does not scan the blockchain for anyonecanspend outputs.

initialfreecoins=2100000000000000
anyonecanspendaremine=1

Quick fix: After creating a wallet with createwallet, in order to scan anyonecanspends run either importprivkey <any_key>(tested) and ``rescanblockchain or(should work, but not tested).

If this is annoying/unergonomic to fix, we should at least update the documentation about this behavior. Notably, our tutorials from https://elementsproject.org/elements-code-tutorial/basic-operations won't work.

sanket1729 avatar Jan 30 '21 02:01 sanket1729

Thanks for this. I thought I was going crazy not seeing the balance no matter what I did. rescanblockchain did it for me (no need for importprivkey).

kallewoof avatar Jul 07 '21 06:07 kallewoof

@sanket1729 I was in the process of testing 0.21 against the tutorial code when an issue arose - can't see initialfreecoins - your fix (no need to import here, just rescan) fixed it. So I will update the ,org tutorial with createwallet and rescan use. Cheers.

Additionally the elements repo's contrib copies of elements1.conf and elements2.conf files have changed and they don't work with the .org tutorial now - I will diverge them and have the .org show it's own confs to use. The one on the elements repo were supposed to support the python examples but I used them in the .org tutorial as they worked but it can have its own now.

wintercooled avatar Oct 20 '21 12:10 wintercooled