Fix: "tree signing session not found" error (#323)

* failing test

* fix duplicate input register

* fix btc-embedded coin selection

* rename test

* add checks in failing test case

* fixes GetEventStream

* add TODO comment in createPoolTx

* update with master changes

* fix server unit test

* increase liquidity of testing ASP

* simplify AliceSeveralPaymentsBob test
This commit is contained in:
Louis Singer
2024-09-20 12:03:12 +02:00
committed by GitHub
parent 5c2065ad47
commit 9e3d667b51
13 changed files with 310 additions and 104 deletions

View File

@@ -63,7 +63,27 @@ func (m *paymentsMap) push(payment domain.Payment, boardingInputs []ports.Boardi
defer m.lock.Unlock()
if _, ok := m.payments[payment.Id]; ok {
return fmt.Errorf("duplicated inputs")
return fmt.Errorf("duplicated payment %s", payment.Id)
}
for _, input := range payment.Inputs {
for _, pay := range m.payments {
for _, pInput := range pay.Inputs {
if input.VtxoKey.Txid == pInput.VtxoKey.Txid && input.VtxoKey.VOut == pInput.VtxoKey.VOut {
return fmt.Errorf("duplicated input, %s:%d already used by payment %s", input.VtxoKey.Txid, input.VtxoKey.VOut, pay.Id)
}
}
}
}
for _, input := range boardingInputs {
for _, pay := range m.payments {
for _, pBoardingInput := range pay.boardingInputs {
if input.Txid == pBoardingInput.Txid && input.VOut == pBoardingInput.VOut {
return fmt.Errorf("duplicated boarding input, %s:%d already used by payment %s", input.Txid, input.VOut, pay.Id)
}
}
}
}
m.payments[payment.Id] = &timedPayment{payment, boardingInputs, time.Now(), time.Time{}}