mirror of
https://github.com/aljazceru/lspd.git
synced 2026-01-04 22:54:30 +01:00
Don't fail when adding twice the same payment_hash
This commit is contained in:
3
db.go
3
db.go
@@ -60,7 +60,8 @@ func registerPayment(destination, paymentHash, paymentSecret []byte, incomingAmo
|
||||
commandTag, err := pgxPool.Exec(context.Background(),
|
||||
`INSERT INTO
|
||||
payments (destination, payment_hash, payment_secret, incoming_amount_msat, outgoing_amount_msat)
|
||||
VALUES ($1, $2, $3, $4, $5)`,
|
||||
VALUES ($1, $2, $3, $4, $5)
|
||||
ON CONFLICT DO NOTHING`,
|
||||
destination, paymentHash, paymentSecret, incomingAmountMsat, outgoingAmountMsat)
|
||||
log.Printf("registerPayment(%x, %x, %x, %v, %v) rows: %v err: %v",
|
||||
destination, paymentHash, paymentSecret, incomingAmountMsat, outgoingAmountMsat, commandTag.RowsAffected(), err)
|
||||
|
||||
Reference in New Issue
Block a user