Skip to content

Commit 1e575f8

Browse files
Drop need to store pending inbound payments
and replace payment_secret with encrypted metadata See docs on verify_inbound_payment for details
1 parent 7e84c5c commit 1e575f8

File tree

4 files changed

+293
-19
lines changed

4 files changed

+293
-19
lines changed

lightning/src/chain/keysinterface.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use ln::script::ShutdownScript;
4040

4141
use prelude::*;
4242
use core::sync::atomic::{AtomicUsize, Ordering};
43-
use io::{self, Error};
43+
use io::{self, Error, Read};
4444
use ln::msgs::{DecodeError, MAX_VALUE_MSAT};
4545

4646
/// Used as initial key material, to be expanded into multiple secret keys (but not to be used
@@ -49,6 +49,19 @@ use ln::msgs::{DecodeError, MAX_VALUE_MSAT};
4949
#[derive(Hash, Copy, Clone, PartialEq, Eq, Debug)]
5050
pub struct KeyMaterial(pub [u8;32]);
5151

52+
impl Writeable for KeyMaterial {
53+
fn write<W: Writer>(&self, w: &mut W) -> Result<(), io::Error> {
54+
self.0.write(w)
55+
}
56+
}
57+
58+
impl Readable for KeyMaterial {
59+
fn read<R: Read>(r: &mut R) -> Result<Self, DecodeError> {
60+
let buf: [u8; 32] = Readable::read(r)?;
61+
Ok(KeyMaterial(buf))
62+
}
63+
}
64+
5265
/// Information about a spendable output to a P2WSH script. See
5366
/// SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this.
5467
#[derive(Clone, Debug, PartialEq)]

0 commit comments

Comments
 (0)