Skip to content

Sync bug with Electrum #96

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

Closed
i5hi opened this issue May 26, 2022 · 3 comments
Closed

Sync bug with Electrum #96

i5hi opened this issue May 26, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@i5hi
Copy link
Contributor

i5hi commented May 26, 2022

Issue

A wallet using electrum node does not sync on first or second try and requires another command - in this case get_new_address to trigger a correct sync.

Reproduction Steps

  • Clear bdk-bitcoin working directory
  • Run sync and get_balance (n number of times)
  • Get 0 balance
  • Run get_new_address (once)
  • Rerun sync and get_balance (once)
  • Get correct balance
~/Code ❯ rm -ri ~/.bdk-bitcoin
                                                                                                                                                            
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" get_balance    
{
  "satoshi": 0
}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" sync       
{}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" get_balance
{
  "satoshi": 0
}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" sync          
{}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" get_balance 
{
  "satoshi": 0
}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" get_new_address
{
  "address": "tb1q883xtcfqlw0744rwx3c583lujhn8mpfnr35pvx"
}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" sync           
{}
~/Code ❯ bdk-cli wallet -d "wpkh([8099ce1e/84h/1h/0h]tpubDCBjCC5aZ6wXLtZMSJDkBYZ3AFuors2YzzBhD5ZqP3uPqbzzH5YjD2CA9HDhUYNhrqq67v4XAN93KSbSL4bwa5hEvidkFuj7ycWA7EYzp41/1/*)" get_balance    
{
  "satoshi": 1154933
}
@notmandatory notmandatory added the bug Something isn't working label May 26, 2022
@i5hi
Copy link
Contributor Author

i5hi commented May 29, 2022

I think this is related to #95 .

I think it can be closed.

@i5hi
Copy link
Contributor Author

i5hi commented May 29, 2022

I think get_new_address here updates the address index which then triggers sync to catch it properly.

@notmandatory
Copy link
Member

Yes I think it's related, if you can resolve the issue by increasing your sync --max_addresses then please close this issue too.

@i5hi i5hi closed this as completed May 29, 2022
@i5hi i5hi moved this to Done in BDK-CLI Roadmap May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants