multi: make input.OutPoint return wire.OutPoint

This commit is contained in:
yyforyongyu
2024-03-27 17:07:48 +08:00
parent fce86f9b22
commit e771993785
21 changed files with 136 additions and 134 deletions

View File

@@ -67,10 +67,10 @@ func newBackupTask(id wtdb.BackupID, sweepPkScript []byte) *backupTask {
func (t *backupTask) inputs() map[wire.OutPoint]input.Input {
inputs := make(map[wire.OutPoint]input.Input)
if t.toLocalInput != nil {
inputs[*t.toLocalInput.OutPoint()] = t.toLocalInput
inputs[t.toLocalInput.OutPoint()] = t.toLocalInput
}
if t.toRemoteInput != nil {
inputs[*t.toRemoteInput.OutPoint()] = t.toRemoteInput
inputs[t.toRemoteInput.OutPoint()] = t.toRemoteInput
}
return inputs
@@ -297,7 +297,7 @@ func (t *backupTask) craftSessionPayload(
commitType := t.commitmentType
for _, inp := range inputs {
// Lookup the input's new post-sort position.
i := inputIndex[*inp.OutPoint()]
i := inputIndex[inp.OutPoint()]
// Construct the full witness required to spend this input.
inputScript, err := inp.CraftInputScript(

View File

@@ -580,10 +580,10 @@ func testBackupTask(t *testing.T, test backupTaskTest) {
// task's inputs() method.
expInputs := make(map[wire.OutPoint]input.Input)
if task.toLocalInput != nil {
expInputs[*task.toLocalInput.OutPoint()] = task.toLocalInput
expInputs[task.toLocalInput.OutPoint()] = task.toLocalInput
}
if task.toRemoteInput != nil {
expInputs[*task.toRemoteInput.OutPoint()] = task.toRemoteInput
expInputs[task.toRemoteInput.OutPoint()] = task.toRemoteInput
}
// Assert that the inputs method returns the correct slice of