Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

getAccount on two difference indices clobbers their UTXOS #229

Closed
dashameter opened this issue Feb 10, 2021 · 0 comments · Fixed by #233
Closed

getAccount on two difference indices clobbers their UTXOS #229

dashameter opened this issue Feb 10, 2021 · 0 comments · Fixed by #233
Labels
bug Something isn't working

Comments

@dashameter
Copy link
Contributor

@shumkov#3835 @antouhou#8806

Consider getAccount() on two separate accounts to keep UTXO management isolated:

        client.account0 = await client.wallet.getAccount({ index: 0 })
        console.log('client.account0 :>> ', client.account0.BIP44PATH)

        client.account5 = await client.wallet.getAccount({ index: 5 })
        console.log('client.account5 :>> ', client.account5.BIP44PATH)

        const accountInfo = await client.account0.getUTXOS()
        const accountInfo5 = await client.account5.getUTXOS()

        console.log('account0 UTXOS', JSON.stringify(accountInfo[0]))
        console.log('account5 UTXOS', JSON.stringify(accountInfo5[0]))

produces:

client.account0 :>>  m/44'/1'/0'
client.account5 :>>  m/44'/1'/5'

account0 UTXOS {"address":"yPKSLNqX7ygjw2Btts2dRjwQBHWDB1sBiN","txid":"5a2731453e2f1f9cc99ceb13123166e2b7694965b35206886d7c4e338d7fca3c","vout":1,"scriptPubKey":"76a91420e7f2b5e320abb31fca0fa65e20f0efc8ac056d88ac","amount":123.01180996}

account5 UTXOS {"address":"yPKSLNqX7ygjw2Btts2dRjwQBHWDB1sBiN","txid":"5a2731453e2f1f9cc99ceb13123166e2b7694965b35206886d7c4e338d7fca3c","vout":1,"scriptPubKey":"76a91420e7f2b5e320abb31fca0fa65e20f0efc8ac056d88ac","amount":123.01180996}

account5.getUTXOS() shows the UTXOS from account0 (and the other way around), they get clobbered together.

Expected Behavior

I expected them to be isolated for greater coin selection control.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

1 participant