projectpai / paicoin

Official repo of PAI Coin
https://projectpai.com
MIT License
63 stars 35 forks source link

Auto ticket purchase reports low available balance despite having substantial funds #372

Open pgerzani opened 3 years ago

pgerzani commented 3 years ago

I've noticed that the secondary voting/staking node is saying it does not have enough balance to buy tickets:

2020-11-15 13:48:04 CTicketBuyer: Skipping purchase: low available balance

I noticed that yesterday as well, so I thought it might be due to a lot of outstanding purchases in the mempool. So, I transferred 1M PAI to the node and yet it still shows it:

ubuntu@ip-172-31-13-92:~/paicoin$ paicoin-cli listaccounts
{
  "": 2299862.39259082
}
ubuntu@ip-172-31-13-92:~/paicoin$ paicoin-cli getwalletinfo
{
  "walletname": "wallet.dat",
  "walletversion": 139900,
  "balance": 898716.85776986,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 5096.00000000,
  "txcount": 40059,
  "keypoololdest": 1605180877,
  "keypoolsize": 1000,
  "keypoolsize_hd_internal": 999,
  "paytxfee": 0.00000000,
  "hdmasterkeyid": "5ae2f76198a1c99f608944f0c517c2dfdeb73ce3"
}

So, I'm not really sure what is going on?

sebastianrusu commented 3 years ago

This is an issue with displaying the balance and is solved in https://github.com/projectpai/paicoin/pull/373.

judewang commented 3 years ago

@sebastianrusu I have 666 PAI showed as available balance, but I still got CTicketBuyer: Skipping purchase: low available balance, too.

➜ pc getticketfee
5.00000000 PAI/kB

➜ pc listaccounts
{
  "": -50.00004520,
  "pocket": 666.00000000
}

➜ pc ticketbuyerconfig
{
  "buytickets": true,
  "account": "pocket",
  "maintain": 100000000,
  "votingAccount": "",
  "votingAddress": "",
  "rewardAddress": "",
  "poolFeeAddress": "PeaLYKfDzzCWqKe1DRVz2uR1iJPf2pnDNh",
  "poolFees": 0,
  "limit": 5,
  "minConf": 1,
  "expiry": 144
}

➜ pc getwalletinfo
{
  "walletname": "wallet.dat",
  "walletversion": 139900,
  "available_balance": 665.99995480,
  "balance": 665.99995480,
  "total_staked_balance": 0.00000000,
  "staked_balance_mempool": 0.00000000,
  "staked_balance_immature": 0.00000000,
  "staked_balance_live": 0.00000000,
  "staked_balance_voted": 0.00000000,
  "staked_balance_missed": 0.00000000,
  "staked_balance_expired": 0.00000000,
  "staked_balance_revoked": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "legacy_balance": -0.00004520,
  "rewards": 0.00000000,
  "refunds": 0.00000000,
  "mined": 0.00000000,
  "txcount": 2,
  "keypoololdest": 1619490899,
  "keypoolsize": 1000,
  "keypoolsize_hd_internal": 999,
  "unlocked_until": 0,
  "paytxfee": 0.00000000,
  "total_fees": 0.00004520,
  "hdmasterkeyid": "5a8ee04184dcc7992e2451e3905e20b382a03064"
}

My full node is v2.3.0, I followed the instructions but still cannot let the ticketbuyer running successfully.