multi: use txid instead of tx in BreachRetribution

This commit replaces the field `BreachTransaction` with `BreachTxHash`
as there's no need to pass that large raw transaction.
This commit is contained in:
yyforyongyu committed 2022-04-20 01:18:14 +08:00
1 parent 37b11c4503
commit 953767961e
7 files changed
+23 -23

No files matched your search

+1 -1
View File
@@ -1243,7 +1243,7 @@ func newRetributionInfo(chanPoint *wire.OutPoint,
}
return &retributionInfo{
commitHash: breachInfo.BreachTransaction.TxHash(),
commitHash: breachInfo.BreachTxHash,
chainHash: breachInfo.ChainHash,
chanPoint: *chanPoint,
breachedOutputs: breachedOutputs,
+4 -4
View File
@@ -1051,7 +1051,7 @@ func TestBreachHandoffSuccess(t *testing.T) {
processACK <- brarErr
},
BreachRetribution: &lnwallet.BreachRetribution{
BreachTransaction: bobClose.CloseTx,
BreachTxHash: bobClose.CloseTx.TxHash(),
LocalOutputSignDesc: &input.SignDescriptor{
Output: &wire.TxOut{
PkScript: breachKeys[0],
@@ -1085,7 +1085,7 @@ func TestBreachHandoffSuccess(t *testing.T) {
processACK <- brarErr
},
BreachRetribution: &lnwallet.BreachRetribution{
BreachTransaction: bobClose.CloseTx,
BreachTxHash: bobClose.CloseTx.TxHash(),
LocalOutputSignDesc: &input.SignDescriptor{
Output: &wire.TxOut{
PkScript: breachKeys[0],
@@ -1137,7 +1137,7 @@ func TestBreachHandoffFail(t *testing.T) {
processACK <- brarErr
},
BreachRetribution: &lnwallet.BreachRetribution{
BreachTransaction: bobClose.CloseTx,
BreachTxHash: bobClose.CloseTx.TxHash(),
LocalOutputSignDesc: &input.SignDescriptor{
Output: &wire.TxOut{
PkScript: breachKeys[0],
@@ -1179,7 +1179,7 @@ func TestBreachHandoffFail(t *testing.T) {
processACK <- brarErr
},
BreachRetribution: &lnwallet.BreachRetribution{
BreachTransaction: bobClose.CloseTx,
BreachTxHash: bobClose.CloseTx.TxHash(),
LocalOutputSignDesc: &input.SignDescriptor{
Output: &wire.TxOut{
PkScript: breachKeys[0],
+1 -1
View File
@@ -812,7 +812,7 @@ func (c *chainWatcher) handlePossibleBreach(commitSpend *chainntnfs.SpendDetail,
// own broadcasted state we are looking at. Therefore check that the
// commit matches before assuming it was a breach.
commitHash := commitSpend.SpendingTx.TxHash()
if retribution.BreachTransaction.TxHash() != commitHash {
if retribution.BreachTxHash != commitHash {
return false, nil
}