6

I am experimenting with the testnet wallet, so I did a sweep_all to my own address to see how it worked. And so this line came up:

Sweeping 0.000000000000 for a total fee of 0.048000000000. Is this okay? (Y/Yes/N/No)

I thought it was strange given that there were unlocked coins in the wallet, but I went on anyway and it did sweep all the unlocked outputs, as expected. So it seems that the only thing is that it is not printing the correct balance in the prompt. Has anyone else had the same experience?

EDIT: It just occurred to me, after seeing the transaction on a block explorer with value 0, that maybe this is due to ringCT not making amounts visible. Still, even if that is the case, the wallet should know the amount.

1 Answer 1

2

Total and fee calculation seems to happen here:

// give user total and fee, and prompt to confirm
uint64_t total_fee = 0, total_unmixable = 0;
for (size_t n = 0; n < ptx_vector.size(); ++n)
{
  total_fee += ptx_vector[n].fee;
  for (const auto &vin: ptx_vector[n].tx.vin)
  {
    if (vin.type() == typeid(txin_to_key))
      total_unmixable += boost::get<txin_to_key>(vin).amount;
  }
}

Printing happens a few lines later:

prompt_str = (boost::format(tr("Sweeping %s for a total fee of %s.  Is this okay?  (Y/Yes/N/No)")) %
    print_money(total_unmixable) %
    print_money(total_fee)).str();

Since the correct amount of Monero was actually swept and transacted, the bug is most likely somewhere in the printing, though I'm not seeing anything obvious.

Edit: This is an open issue on github

1
  • 2
    It is rct, as the poster suspected. boost::get<txin_to_key>(vin).amount is zero in the rct case, and needs replacing in that case.
    – user36303
    Oct 7, 2016 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.