diff --git a/signet-dashboard/public/utxo-list.html b/signet-dashboard/public/utxo-list.html
index d86e0c4..ff71975 100644
--- a/signet-dashboard/public/utxo-list.html
+++ b/signet-dashboard/public/utxo-list.html
@@ -147,6 +147,61 @@
background: #6c757d;
cursor: not-allowed;
}
+ .consolidate-button {
+ background: #ffc107;
+ color: #000;
+ border: none;
+ padding: 10px 20px;
+ border-radius: 5px;
+ cursor: pointer;
+ font-size: 1em;
+ margin-top: 10px;
+ }
+ .consolidate-button:hover {
+ background: #e0a800;
+ }
+ .consolidate-button:disabled {
+ background: #6c757d;
+ cursor: not-allowed;
+ }
+ .sortable-header {
+ cursor: pointer;
+ user-select: none;
+ position: relative;
+ }
+ .sortable-header:hover {
+ background: #e9ecef;
+ }
+ .sort-arrow {
+ display: inline-block;
+ margin-left: 5px;
+ font-size: 0.8em;
+ }
+ .pagination {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ gap: 10px;
+ margin: 20px 0;
+ }
+ .pagination-button {
+ padding: 8px 16px;
+ background: #007bff;
+ color: white;
+ border: none;
+ border-radius: 5px;
+ cursor: pointer;
+ }
+ .pagination-button:hover:not(:disabled) {
+ background: #0056b3;
+ }
+ .pagination-button:disabled {
+ background: #6c757d;
+ cursor: not-allowed;
+ }
+ .pagination-info {
+ font-weight: bold;
+ }
.total-amount {
font-size: 1.2em;
font-weight: bold;
@@ -208,7 +263,8 @@
Total d'UTXO : -
-
Capacité d'ancrage restante : - ancrages
+
Capacité d'ancrage restante : - ancrages (- UTXOs confirmés)
+
Montant total : -
Dernière mise à jour : -
@@ -231,12 +287,58 @@
diff --git a/signet-dashboard/src/bitcoin-rpc.js b/signet-dashboard/src/bitcoin-rpc.js
index 4e78a06..ee62bf6 100644
--- a/signet-dashboard/src/bitcoin-rpc.js
+++ b/signet-dashboard/src/bitcoin-rpc.js
@@ -338,7 +338,7 @@ class BitcoinRPC {
jsonrpc: '1.0',
id: 'listunspent',
method: 'listunspent',
- params: [0], // Inclure les non confirmés
+ params: [1], // Minimum 1 confirmation to avoid too-long-mempool-chain errors
}),
});
@@ -673,11 +673,22 @@ class BitcoinRPC {
return b.amount - a.amount;
});
- // Calculer le nombre d'UTXO disponibles pour l'ancrage (> 2000 sats et non dépensés)
+ // Calculer le nombre d'UTXO disponibles pour l'ancrage (> 2000 sats, confirmés et non dépensés)
const allUtxos = [...blocRewards, ...anchors, ...changes];
const minAnchorAmount = 2000 / 100000000; // 2000 sats en BTC
const availableForAnchor = allUtxos.filter(utxo =>
- utxo.amount >= minAnchorAmount && !utxo.isSpentOnchain && !utxo.isLockedInMutex
+ utxo.amount >= minAnchorAmount &&
+ (utxo.confirmations || 0) > 0 && // Only confirmed UTXOs
+ !utxo.isSpentOnchain &&
+ !utxo.isLockedInMutex
+ ).length;
+
+ // Compter les UTXOs confirmés disponibles pour l'ancrage
+ const confirmedAvailableForAnchor = allUtxos.filter(utxo =>
+ utxo.amount >= minAnchorAmount &&
+ (utxo.confirmations || 0) > 0 && // Only confirmed UTXOs
+ !utxo.isSpentOnchain &&
+ !utxo.isLockedInMutex
).length;
// Mettre à jour le cache
@@ -725,6 +736,7 @@ class BitcoinRPC {
fees,
total: allUtxos.length,
availableForAnchor,
+ confirmedAvailableForAnchor,
};
} catch (error) {
logger.error('Error getting UTXO list', { error: error.message });
@@ -732,6 +744,266 @@ class BitcoinRPC {
}
}
+ /**
+ * Consolide les UTXOs de moins de 2500 sats en un gros UTXO
+ * @returns {Promise