mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
config: add a new --debughtlc config parameter
This commit adds a new configuration parameter to the deamon: ‘DebugHTLC’. When true, all outgoing HTLC’s sent via the RPC interface will be sent paying to a special rHash value which all lnd nodes also with the flag activated know the preimage to. Therefore all payments sent to a 1-hop node will immediately be settled by that node. By default, this flag is false, it it only intended to be used to exercise local changes to 1-hop behavior manually.
This commit is contained in:
@@ -104,6 +104,15 @@ func newServer(listenAddrs []string, notifier chainntnfs.ChainNotifier,
|
||||
quit: make(chan struct{}),
|
||||
}
|
||||
|
||||
// If the debug HTLC flag is on, then we invoice a "master debug"
|
||||
// invoice which all outgoing payments will be sent and all incoming
|
||||
// HTLC's with the debug R-Hash immediately settled.
|
||||
if cfg.DebugHTLC {
|
||||
kiloCoin := btcutil.Amount(btcutil.SatoshiPerBitcoin * 1000)
|
||||
s.invoices.AddDebugInvoice(kiloCoin, *debugPre)
|
||||
srvrLog.Debugf("Debug HTLC invoice inserted, preimage=%x, hash=%x",
|
||||
debugPre[:], debugHash[:])
|
||||
}
|
||||
|
||||
s.utxoNursery = newUtxoNursery(notifier, wallet)
|
||||
|
||||
|
Reference in New Issue
Block a user