feat(wallet): show pending mempool balance and exclude unconfirmed UTXOs from spending

TransactionFactory now selects only confirmed UTXOs (height > 0), so
mempool funds are visible as pending balance but never spendable, with
a clear error when only unconfirmed funds are available. GUI and CLI
labels updated to "in attesa di conferma (non spendibile)".
This commit is contained in:
2026-06-11 11:34:13 +02:00
parent af10482e54
commit ece634f42e
4 changed files with 27 additions and 6 deletions
@@ -91,6 +91,19 @@ public class TransactionFactoryTests
feeRateSatPerVByte: 2, changeIndex: 0));
}
[Fact]
public void Gli_utxo_in_mempool_non_sono_spendibili()
{
var account = Account();
var (utxos, txs) = Fund(account, 1_000_000);
utxos[0].Height = 0; // in mempool: visibile nel saldo pending, non spendibile
var ex = Assert.Throws<WalletSpendException>(() => new TransactionFactory(account).Build(
utxos, txs, account.GetReceiveAddress(1), amountSats: 100_000,
feeRateSatPerVByte: 2, changeIndex: 0));
Assert.Contains("in attesa di conferma", ex.Message);
}
[Fact]
public void Gli_utxo_congelati_sono_esclusi_dalla_spesa()
{