File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use secp256k1::Signature;
10
10
use secp256k1:: key:: { PublicKey , SecretKey } ;
11
11
use bitcoin:: util:: hash:: Sha256dHash ;
12
12
use bitcoin:: blockdata:: script:: Script ;
13
+ use bitcoin:: blockdata:: transaction:: OutPoint as BitcoinOutPoint ;
13
14
use std:: marker:: Sized ;
14
15
use ln:: msgs:: DecodeError ;
15
16
use ln:: channelmanager:: { PaymentPreimage , PaymentHash } ;
@@ -420,3 +421,20 @@ impl<R, T> Readable<R> for Option<T>
420
421
}
421
422
}
422
423
}
424
+
425
+
426
+ impl < R : Read > Readable < R > for BitcoinOutPoint {
427
+ fn read ( r : & mut R ) -> Result < Self , DecodeError > {
428
+ let txid = Readable :: read ( r) ?;
429
+ let vout = Readable :: read ( r) ?;
430
+ Ok ( BitcoinOutPoint { txid, vout } )
431
+ }
432
+ }
433
+
434
+ impl Writeable for BitcoinOutPoint {
435
+ fn write < W : Writer > ( & self , w : & mut W ) -> Result < ( ) , :: std:: io:: Error > {
436
+ self . txid . as_bytes ( ) . write ( w) ?;
437
+ w. write_all ( & byte_utils:: be32_to_array ( self . vout ) ) ?;
438
+ Ok ( ( ) )
439
+ }
440
+ }
You can’t perform that action at this time.
0 commit comments