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: update unconfirmed locked balance first during rescan #387

Merged
merged 1 commit into from
Mar 19, 2020

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Mar 10, 2020

Closes #381

Replaces #385

Explanation here: #381 (comment)

The test runs through the REVEAL of an auction two ways: First, by sending and then confirming each covenant. Second, by JUST confirming each covenant without first "sending". The difference from perspective of the txdb is that if a TX is not already inserted in an unconfirmed state, the balances will be wonky when the TX is confirmed.

Like #387 the patch is to first quickly update the "unconfirmed" data for a TX before proceeding (in the case where txdb sees a TX for the very first time, in a block)

test/wallet-test.js Outdated Show resolved Hide resolved
boymanjor
boymanjor previously approved these changes Mar 19, 2020
Copy link
Contributor

@boymanjor boymanjor left a comment

Choose a reason for hiding this comment

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

LGTM with a couple of nits on comments.

lib/wallet/txdb.js Outdated Show resolved Hide resolved
test/wallet-test.js Outdated Show resolved Hide resolved
@pinheadmz
Copy link
Member Author

@boymanjor thanks bruh. Updated those comments and pushed.

@codecov-io
Copy link

Codecov Report

Merging #387 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #387      +/-   ##
==========================================
+ Coverage   60.37%   60.42%   +0.05%     
==========================================
  Files         129      129              
  Lines       34671    34673       +2     
  Branches     5859     5860       +1     
==========================================
+ Hits        20931    20952      +21     
+ Misses      13740    13721      -19     
Impacted Files Coverage Δ
lib/wallet/txdb.js 79.23% <100.00%> (+0.34%) ⬆️
lib/protocol/consensus.js 87.75% <0.00%> (-1.03%) ⬇️
lib/net/peer.js 41.90% <0.00%> (-0.30%) ⬇️
lib/net/pool.js 35.99% <0.00%> (ø)
lib/script/script.js 59.40% <0.00%> (+0.08%) ⬆️
lib/covenants/namestate.js 87.17% <0.00%> (+0.20%) ⬆️
lib/wallet/wallet.js 62.71% <0.00%> (+0.48%) ⬆️
lib/primitives/mtx.js 69.24% <0.00%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98b33cc...6eb92ba. Read the comment docs.

@boymanjor boymanjor self-requested a review March 19, 2020 20:59
@boymanjor boymanjor dismissed their stale review March 19, 2020 21:00

I'd like to investigate if we should solve this issue further up the call stack.

Copy link
Contributor

@boymanjor boymanjor left a comment

Choose a reason for hiding this comment

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

Ok, I think this is the right spot. Thanks for the clarification @pinheadmz!

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.

Assertion failed when calling sendredeem or sendupdate on imported wallet
5 participants