mirror of
https://github.com/ACINQ/eclair.git
synced 2025-02-22 14:22:39 +01:00
improved watcher logs
This commit is contained in:
parent
71a38e5e95
commit
3d08c7e391
1 changed files with 3 additions and 2 deletions
|
@ -89,8 +89,9 @@ class PeerWatcher(client: ExtendedBitcoinClient)(implicit ec: ExecutionContext =
|
|||
val csvTimeout = Scripts.csvTimeout(tx)
|
||||
if (csvTimeout > 0) {
|
||||
require(tx.txIn.size == 1, s"watcher only supports tx with 1 input, this tx has ${tx.txIn.size} inputs")
|
||||
log.info(s"this tx has a relative timeout of ${csvTimeout} blocks, watching parent tx: txid=${tx.txid} tx=${Transaction.write(tx)}")
|
||||
self ! WatchConfirmed(self, tx.txIn(0).outPoint.txid, minDepth = 1, BITCOIN_PARENT_TX_CONFIRMED(tx))
|
||||
val parentTxid = tx.txIn(0).outPoint.txid
|
||||
log.info(s"this tx has a relative timeout of ${csvTimeout} blocks, watching parent tx: parenttxid=$parentTxid txid=${tx.txid} tx=${Transaction.write(tx)}")
|
||||
self ! WatchConfirmed(self, parentTxid, minDepth = 1, BITCOIN_PARENT_TX_CONFIRMED(tx))
|
||||
} else if (cltvTimeout > blockCount) {
|
||||
log.info(s"delaying publication of tx until block=$cltvTimeout (curblock=$blockCount): txid=${tx.txid} tx=${Transaction.write(tx)}")
|
||||
val block2tx1 = block2tx.updated(cltvTimeout, tx +: block2tx.getOrElse(cltvTimeout, Seq.empty[Transaction]))
|
||||
|
|
Loading…
Add table
Reference in a new issue