lnd.xprv/channeldb/migration_01_to_11/payment_control.go

22 lines
513 B
Go
Raw Normal View History

package migration_01_to_11
2021-04-26 20:08:11 +03:00
import "github.com/lightningnetwork/lnd/kvdb"
// fetchPaymentStatus fetches the payment status of the payment. If the payment
// isn't found, it will default to "StatusUnknown".
2020-05-07 01:48:00 +03:00
func fetchPaymentStatus(bucket kvdb.RBucket) PaymentStatus {
if bucket.Get(paymentSettleInfoKey) != nil {
return StatusSucceeded
}
if bucket.Get(paymentFailInfoKey) != nil {
return StatusFailed
}
if bucket.Get(paymentCreationInfoKey) != nil {
return StatusInFlight
}
return StatusUnknown
}