Get Balance returning crazy high and unrealistic numbers.
Using curl to make a 'get_balance' request and the following response occurs.
{"id":"id","jsonrpc":"2.0","result":{"locked_or_unconfirmed":283400000000,"spendable":18446743888337551616,"spendable_dust":1149890047}}p
As much as I wish this were real, it's not, and it renders the wallet useless.
Lawl this coin is like a drama TV with no plot
I would like to setup Bytecoinpool in South Alabama USA Please email me [email protected] or message me on twitter @austinyeshua or facebook @yeshuaaustin Google sms 2512702872
Try to clear wallet cache...
I've cleared wallet cache but I have the same issue...
It seems that the problem is that Amount is unsigned int (uint64_t). In these subtractions the result is less than zero... but why is it less than zero?
I think this problem occurs when there are several addresses in a wallet. The balance is wrong between addresses
struct Balance {
Amount spendable = 0;
Amount spendable_dust = 0;
Amount locked_or_unconfirmed = 0;
Amount total() const {
return spendable + spendable_dust + locked_or_unconfirmed;
} // This fun serves as a documentation.
};
WalletState.cpp
static void combine_balance(api::Balance &balance, const api::Output &output, int locked_op, int spendable_op) {
Amount &mod = output.dust ? balance.spendable_dust : balance.spendable;
if (locked_op > 0)
balance.locked_or_unconfirmed += output.amount;
if (locked_op < 0)
balance.locked_or_unconfirmed -= output.amount; ***(LESS THAN ZERO)
if (spendable_op > 0)
mod += output.amount;
if (spendable_op < 0)
mod -= output.amount; ***(LESS THAN ZERO)
}