-
Notifications
You must be signed in to change notification settings - Fork 274
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
Auction info not showing all bids #582
Comments
This is expected behavior. HSD only watches for a name after its first participation in an auction. If Alice opens an auction, her wallet will collect all the bids from now on. This is precisely why If you add an |
I can reproduce this on master branch, this is the output i got:
The second Wallet seems to be oblivious of the first bid, rescanning didn't help. |
I cannot agree it's expected behaviour for the user. |
This is what I get on
Rescanning didn't show the output either
|
Meanwhile
|
Well as of right now re-scanning is supposed to rescan for all other bids, which makes sense to me. Though I have no idea if I did something wrong, but re-scanning didn't help the situation for some reason? |
@Anunayj The wallet does not index every transaction for every name all the time, it has an internal watchlist. A name is only added to that wacthlist when the wallet itself sends an auction-related transaction. The only way to know what bids happened in the past is to rescan -- but a simple rescan won't work because a rescan starts with the wallet reverting blocks and rewinding history, then playing it forward again. When you rewind history, you revert the moment where the wallet started watching a name! So as you rescan forwards again, you continue to ignore bids until the wallet itself participates in the auction. In #499 I have a commit that may change this behavior, but a rescan will still be required. Again, this is precisely why Because a rescan is a disruptive action, it is not automatic. Applications like Namebase and hnsnetwork.com probably index all auction activity for all names all the time. A user interested in managing all that extra data can have the user experience you're discussing, but I don't think that should be the default for hsd. |
I see, though is there a way to fix it if i have done that? bid before importing name. |
I modified your script a bit, here's basically a refactor showing your initial UX: export HSD_NETWORK=regtest
#create 2 wallets, populate them with some hns
hsw-cli mkwallet qwerty
hsw-cli mkwallet asdfg
hsw-rpc selectwallet qwerty
hsd-rpc generatetoaddress 200 `hsw-rpc getnewaddress`
hsw-rpc selectwallet asdfg
hsd-rpc generatetoaddress 200 `hsw-rpc getnewaddress`
#make bids
hsw-rpc selectwallet qwerty
hsw-rpc sendopen sad
hsd-rpc generatetoaddress 6 `hsw-rpc getnewaddress`
hsw-rpc sendbid sad 1 1
hsd-rpc generatetoaddress 1 `hsw-rpc getnewaddress`
hsw-rpc selectwallet asdfg
hsw-rpc sendbid sad 2 2
hsd-rpc generatetoaddress 10 `hsw-rpc getnewaddress`
#view the bids from different wallets
printf "\n\nchecking from the first wallet\n\n"
hsw-rpc selectwallet qwerty
hsw-rpc getbids sad
printf "\n\nchecking from the second wallet\n\n"
hsw-rpc selectwallet asdfg
hsw-rpc getbids sad ...and here is modified with export HSD_NETWORK=regtest
#create 2 wallets, populate them with some hns
hsw-cli mkwallet qwerty
hsw-cli mkwallet asdfg
hsw-rpc selectwallet qwerty
hsd-rpc generatetoaddress 200 `hsw-rpc getnewaddress`
hsw-rpc selectwallet asdfg
hsd-rpc generatetoaddress 200 `hsw-rpc getnewaddress`
#make bids
hsw-rpc selectwallet qwerty
hsw-rpc sendopen sad
hsd-rpc generatetoaddress 6 `hsw-rpc getnewaddress`
hsw-rpc sendbid sad 1 1
hsd-rpc generatetoaddress 1 `hsw-rpc getnewaddress`
hsw-rpc selectwallet asdfg
hsw-rpc importname sad
hsw-cli rescan
sleep 2
hsw-rpc sendbid sad 2 2
hsd-rpc generatetoaddress 10 `hsw-rpc getnewaddress`
#view the bids from different wallets
printf "\n\nchecking from the first wallet\n\n"
hsw-rpc selectwallet qwerty
hsw-rpc getbids sad
printf "\n\nchecking from the second wallet\n\n"
hsw-rpc selectwallet asdfg
hsw-rpc getbids sad output:
|
This might be worth looking in to, perhaps the commit I linked to from the other PR would allow this. Or the original logic of |
ig changing |
We want to avoid automatically rescanning I think, so for example in the Bob Wallet implementation it's still two commands but the user only clicks one button. It only needs to rescan a few days work of blocks also, so it's not a huge drag. I think it is worth looking in to enabling importname to work even after the user submits a late bid. I think the commit I referenced above might be the only thing needed, and then the "name already exists" check can probably be removed. Please experiment with this if you have time! |
Ok just checked, PR #499 indeed does fix this issue, doing a rescan shows the second bid. Requiring a rescan for seeing old bids makes sense too. |
closed by #604 |
Reviewing this: #553
I've encountered situation where auction related info was different for different wallets, for example
getbids
orgetauctioninfo
.One wallet does not shows actions from other wallets.
Reproduce script: https://gist.github.com/randomlogin/d110b89a55152551a99ba459e3f8896d
The text was updated successfully, but these errors were encountered: