dcrwallet
dcrwallet copied to clipboard
ticketbuyer.balancetomaintainabsolute not respected
The ticketbuyer.balancetomaintainabsolute setting does not seem to be respected.
My balance is routinely drawn down below this limit when purchasing tickets.
@jrick may i investigate and try fix this one ?
doesn't need much investigation because we understand why this happens -- as utxos are selected, the confirmed balance might dip below this configuration value, since the change will be unconfirmed.
I'm not sure if this is anything we need to fix. Talking about balances (as this config option does) without also talking about the number of confirmations is meaningless.
In my experience (at the time) if you let the wallet run indefinitely, you will get to a point where there is no (or very little) unconfirmed, yet you've fully depleted your balance on tickets.
Aha, I see
@chappjc this is because the unconfirmed balance is going to a different account, e.g. unmixed. This option predates the mixing support and this use case.
That's not my recollection. I suggest running testnet wallets with and without mixing, with a non zero balancetomaintainabsolute. I think in both case it's not just unconfirmed or unmixed change. Maybe I'm wrong and this can be closed, but the wallet would become way over bought into tickets, where either unconfirmed or unmixed account balances don't even come close to the requested setting.
My testnet ticketbuyer is presently not mixing. Will set it and try now.
thanks. let's find out if the option works as i'm recalling, otherwise we should discuss how we'd prefer it to work. if it is "working" then at the very least we need to clarify what the option really does because as is the description is extremely vague.
enableticketbuyer=1
ticketbuyer.limit=200
ticketbuyer.votingaccount=voter
2022-09-30 10:31:03.390 [INF] SYNC: Connected block 0000000081f4f46942dd0f5104067100b7f79714c1e5e44cd17f81d79d6c6b73, height 1003620, 6 wallet transaction(s)
2022-09-30 10:31:03.401 [INF] WLLT: Returning address (account=0 branch=1 child=101353)
2022-09-30 10:31:03.407 [INF] WLLT: Returning address (account=0 branch=1 child=101354)
2022-09-30 10:31:03.407 [INF] WLLT: Inserting unconfirmed transaction a22971b41ef23b617d567d579b36ad6a73de6294883f882a48be7d022a0fc2d8
2022-09-30 10:31:03.408 [DBG] WLLT: Marked address TsUJYwxE9NXHZDH8qzAWDCxtEe3PpVU5zQq used
2022-09-30 10:31:03.408 [DBG] WLLT: Marked address TsVKBDbV6C7PfVxRPYRzx7hBUwqmmmA1zJe used
2022-09-30 10:31:03.410 [DBG] WLLT: Marked address TsUJYwxE9NXHZDH8qzAWDCxtEe3PpVU5zQq used
2022-09-30 10:31:03.410 [DBG] WLLT: Marked address TsVKBDbV6C7PfVxRPYRzx7hBUwqmmmA1zJe used
2022-09-30 10:31:03.411 [DBG] WLLT: Marked address TsUJYwxE9NXHZDH8qzAWDCxtEe3PpVU5zQq used
2022-09-30 10:31:03.412 [DBG] WLLT: Marked address TsVKBDbV6C7PfVxRPYRzx7hBUwqmmmA1zJe used
2022-09-30 10:31:03.412 [INF] WLLT: Split output is a22971b41ef23b617d567d579b36ad6a73de6294883f882a48be7d022a0fc2d8:0
2022-09-30 10:31:03.413 [INF] WLLT: Returning address (account=2147483648 branch=1 child=49504)
2022-09-30 10:31:03.414 [INF] WLLT: Returning address (account=0 branch=1 child=101355)
2022-09-30 10:31:03.415 [INF] WLLT: Inserting unconfirmed transaction a3fca9b80c5e6244e335c54237c4d41aa97ad5b6fdd7f4f0516bc2917cadfa18
2022-09-30 10:31:03.415 [DBG] WLLT: Marked address TshNuNgrgmRPja71GXoT7S4Xw9tk4TdakE5 used
2022-09-30 10:31:03.415 [DBG] WLLT: Accounting for ticket commitment a3fca9b80c5e6244e335c54237c4d41aa97ad5b6fdd7f4f0516bc2917cadfa18:1 (62.22490347 DCR) from the wallet
2022-09-30 10:31:03.415 [DBG] WLLT: Marked address TsZcV5u28cHQxdunXQK6RiSh7S7wrYC1Rdv used
2022-09-30 10:31:03.417 [INF] WLLT: Published ticket purchase a3fca9b80c5e6244e335c54237c4d41aa97ad5b6fdd7f4f0516bc2917cadfa18
2022-09-30 10:31:03.418 [INF] TKBY: Purchased ticket a3fca9b80c5e6244e335c54237c4d41aa97ad5b6fdd7f4f0516bc2917cadfa18 at stake difficulty 62.22487367 DCR
2022-09-30 10:31:08.987 [DBG] RPCS: RPC method "getbalance" invoked by 127.0.0.1:50986
$ dcrctl --testnet --wallet getblockchaininfo | jq '.chain'
"testnet3"
$ dcrctl --testnet --wallet getbalance
{
"balances": [
{
"accountname": "default",
"immaturecoinbaserewards": 0.34395438,
"immaturestakegeneration": 1062.88277825,
"lockedbytickets": 62115.1618048,
"spendable": 0.01959965,
"total": 63195.61792602,
"unconfirmed": 17.20978894,
"votingauthority": 0
},
{
"accountname": "voter",
"immaturecoinbaserewards": 0,
"immaturestakegeneration": 0,
"lockedbytickets": 0,
"spendable": 0,
"total": 0,
"unconfirmed": 0,
"votingauthority": 62115.1320942
},
{
"accountname": "trading",
"immaturecoinbaserewards": 0,
"immaturestakegeneration": 0,
"lockedbytickets": 0,
"spendable": 100,
"total": 100,
"unconfirmed": 0,
"votingauthority": 0
},
{
"accountname": "imported",
"immaturecoinbaserewards": 0,
"immaturestakegeneration": 0,
"lockedbytickets": 0,
"spendable": 0,
"total": 0,
"unconfirmed": 0,
"votingauthority": 0
}
],
"blockhash": "0000000081f4f46942dd0f5104067100b7f79714c1e5e44cd17f81d79d6c6b73",
"totalimmaturecoinbaserewards": 0.34395438,
"totalimmaturestakegeneration": 1062.88277825,
"totallockedbytickets": 62115.1618048,
"totalspendable": 100.01959965,
"cumulativetotal": 63295.61792602,
"totalunconfirmed": 17.20978894,
"totalvotingauthority": 62115.1320942
}
Oh dang, ticketbuyer.limit is the wrong setting. Where did that come from? :angry:
Ok, sorry for the noise, this was just a screw up on my part it seems. With --ticketbuyer.balancetomaintainabsolute=200 and no mixing it's working as expected.
There may be a warranted clarification when mixing is in use, but it seem PEBKAC.
--ticketbuyer.balancetomaintainabsolute= Amount of funds to keep in wallet when purchasing tickets (default: 0 DCR)