lnwallet: return our final local balance from CompleteCooperativeClose
In this commit, add an additional return value to CompleteCooperativeClose. We’ll now report to the caller our final balance in the cooperative closure transaction. We report this as depending on if we’re the initiator or not, our final balance may not exactly match the balance we had in the last state.
This commit is contained in:
2 files changed
+16
-15
No files matched your search
@@ -904,7 +904,7 @@ func TestCooperativeChannelClosure(t *testing.T) {
|
||||
// With the proposals created, both sides should be able to properly
|
||||
// process the other party's signature. This indicates that the
|
||||
// transaction is well formed, and the signatures verify.
|
||||
aliceCloseTx, err := bobChannel.CompleteCooperativeClose(
|
||||
aliceCloseTx, _, err := bobChannel.CompleteCooperativeClose(
|
||||
bobCloseSig, aliceCloseSig, bobDeliveryScript,
|
||||
aliceDeliveryScript, bobFee)
|
||||
if err != nil {
|
||||
@@ -912,7 +912,7 @@ func TestCooperativeChannelClosure(t *testing.T) {
|
||||
}
|
||||
bobCloseSha := aliceCloseTx.TxHash()
|
||||
|
||||
bobCloseTx, err := aliceChannel.CompleteCooperativeClose(
|
||||
bobCloseTx, _, err := aliceChannel.CompleteCooperativeClose(
|
||||
aliceCloseSig, bobCloseSig, aliceDeliveryScript,
|
||||
bobDeliveryScript, aliceFee)
|
||||
if err != nil {
|
||||
@@ -2019,7 +2019,7 @@ func TestCooperativeCloseDustAdherence(t *testing.T) {
|
||||
}
|
||||
bobCloseSig := append(bobSig, byte(txscript.SigHashAll))
|
||||
|
||||
closeTx, err := bobChannel.CompleteCooperativeClose(
|
||||
closeTx, _, err := bobChannel.CompleteCooperativeClose(
|
||||
bobCloseSig, aliceCloseSig,
|
||||
bobDeliveryScript, aliceDeliveryScript, bobFee)
|
||||
if err != nil {
|
||||
@@ -2057,7 +2057,7 @@ func TestCooperativeCloseDustAdherence(t *testing.T) {
|
||||
}
|
||||
bobCloseSig = append(bobSig, byte(txscript.SigHashAll))
|
||||
|
||||
closeTx, err = bobChannel.CompleteCooperativeClose(
|
||||
closeTx, _, err = bobChannel.CompleteCooperativeClose(
|
||||
bobCloseSig, aliceCloseSig,
|
||||
bobDeliveryScript, aliceDeliveryScript, bobFee)
|
||||
if err != nil {
|
||||
@@ -2099,7 +2099,7 @@ func TestCooperativeCloseDustAdherence(t *testing.T) {
|
||||
}
|
||||
bobCloseSig = append(bobSig, byte(txscript.SigHashAll))
|
||||
|
||||
closeTx, err = bobChannel.CompleteCooperativeClose(
|
||||
closeTx, _, err = bobChannel.CompleteCooperativeClose(
|
||||
bobCloseSig, aliceCloseSig,
|
||||
bobDeliveryScript, aliceDeliveryScript, bobFee)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user