mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-30 23:53:41 +02:00
channeldb: refactor payments code
Go-fmt files. Refactored code according to the guidelines. Enhanced payment test: add error checking and individual context for each API call. Add Timestamp field to payment struct.
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
eb4d0e035e
commit
1c7f87c3f1
@@ -116,8 +116,7 @@ func validateInvoice(i *Invoice) error {
|
||||
// insertion will be aborted and rejected due to the strict policy banning any
|
||||
// duplicate payment hashes.
|
||||
func (d *DB) AddInvoice(i *Invoice) error {
|
||||
err := validateInvoice(i)
|
||||
if err != nil {
|
||||
if err := validateInvoice(i); err != nil {
|
||||
return err
|
||||
}
|
||||
return d.Update(func(tx *bolt.Tx) error {
|
||||
|
Reference in New Issue
Block a user