Merge pull request #5036 from halseth/breacharbiter-justice-splitting

[breacharbiter] Split justice tx in case of delayed confirmation.
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2021-05-12 13:42:42 -07:00
commit c0acdd8082
4 files changed
+898 -325

No files matched your search

+8 -1
View File
@@ -67,13 +67,20 @@ func (s *SpendNotifier) Spend(outpoint *wire.OutPoint, height int32,
s.mtx.Lock()
defer s.mtx.Unlock()
var inputIndex uint32
for i, in := range txn.TxIn {
if in.PreviousOutPoint == *outpoint {
inputIndex = uint32(i)
}
}
txnHash := txn.TxHash()
details := &chainntnfs.SpendDetail{
SpentOutPoint: outpoint,
SpendingHeight: height,
SpendingTx: txn,
SpenderTxHash: &txnHash,
SpenderInputIndex: outpoint.Index,
SpenderInputIndex: inputIndex,
}
// Cache details in case of late registration.