channeldb+lnrpc: store the payment pre-image not rhash
Fixes #481. Prior to this commit, payments stored in the channel DB only kept a record of the payment hash. This is a problem as the preimage is what serves as proof of payment and a user should be able to look up this value in the future (not just immediately after payment). Instead of storing both the payment hash and the preimage, we store the preimage only since the hash can be derrived from this using a SHA256. In the RPC listpayments command, we now give the preimage in addition to the payment hash.
This commit is contained in:
1 parent
fc18db0130
commit
0f161c5033
6 files changed
+150
-134
No files matched your search
@@ -1337,6 +1337,7 @@ message InvoiceSubscription {
|
||||
message Payment {
|
||||
/// The payment hash
|
||||
string payment_hash = 1 [json_name = "payment_hash"];
|
||||
|
||||
/// The value of the payment in satoshis
|
||||
int64 value = 2 [json_name = "value"];
|
||||
|
||||
@@ -1348,6 +1349,9 @@ message Payment {
|
||||
|
||||
/// The fee paid for this payment in satoshis
|
||||
int64 fee = 5 [json_name = "fee"];
|
||||
|
||||
/// The payment preimage
|
||||
string payment_preimage = 6 [json_name = "payment_preimage"];
|
||||
}
|
||||
|
||||
message ListPaymentsRequest {
|
||||
|
||||
Reference in new issue
Block a user