| 394 | } |
| 395 | CAmount getBalance() override { return GetBalance(*m_wallet).m_mine_trusted; } |
| 396 | CAmount getAvailableBalance(const CCoinControl& coin_control) override |
| 397 | { |
| 398 | LOCK(m_wallet->cs_wallet); |
| 399 | CAmount total_amount = 0; |
| 400 | // Fetch selected coins total amount |
| 401 | if (coin_control.HasSelected()) { |
| 402 | FastRandomContext rng{}; |
| 403 | CoinSelectionParams params(rng); |
| 404 | // Note: for now, swallow any error. |
| 405 | if (auto res = FetchSelectedInputs(*m_wallet, coin_control, params)) { |
| 406 | total_amount += res->GetTotalAmount(); |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | // And fetch the wallet available coins |
| 411 | if (coin_control.m_allow_other_inputs) { |
| 412 | total_amount += AvailableCoins(*m_wallet, &coin_control).GetTotalAmount(); |
| 413 | } |
| 414 | |
| 415 | return total_amount; |
| 416 | } |
| 417 | bool txinIsMine(const CTxIn& txin) override |
| 418 | { |
| 419 | LOCK(m_wallet->cs_wallet); |
nothing calls this directly
no test coverage detected