File tree Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Expand file tree Collapse file tree 3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,10 @@ async fn main() {
267
267
dbm. clone ( ) ,
268
268
) ) ;
269
269
270
- let mut poller = ChainPoller :: new ( & mut derefed, Network :: from_core_arg ( & conf. btc_network ) . unwrap ( ) ) ;
270
+ let mut poller = ChainPoller :: new (
271
+ & mut derefed,
272
+ Network :: from_core_arg ( & conf. btc_network ) . unwrap ( ) ,
273
+ ) ;
271
274
let ( responder, watcher) = {
272
275
let last_n_blocks = get_last_n_blocks ( & mut poller, tip, IRREVOCABLY_RESOLVED as usize )
273
276
. await . unwrap_or_else ( |e| {
Original file line number Diff line number Diff line change 3
3
use std:: collections:: HashSet ;
4
4
use std:: sync:: { Arc , Mutex } ;
5
5
6
+ use bitcoin:: hashes:: Hash ;
6
7
use bitcoin:: { consensus, BlockHash } ;
7
8
use bitcoin:: { Transaction , Txid } ;
8
- use bitcoin:: hashes:: Hash ;
9
9
10
10
use lightning:: chain;
11
11
use lightning_block_sync:: poll:: ValidatedBlock ;
@@ -95,8 +95,18 @@ impl TransactionTracker {
95
95
impl From < TransactionTracker > for common_msgs:: Tracker {
96
96
fn from ( t : TransactionTracker ) -> Self {
97
97
common_msgs:: Tracker {
98
- dispute_txid : t. dispute_tx . compute_txid ( ) . to_raw_hash ( ) . to_byte_array ( ) . to_vec ( ) ,
99
- penalty_txid : t. penalty_tx . compute_txid ( ) . to_raw_hash ( ) . to_byte_array ( ) . to_vec ( ) ,
98
+ dispute_txid : t
99
+ . dispute_tx
100
+ . compute_txid ( )
101
+ . to_raw_hash ( )
102
+ . to_byte_array ( )
103
+ . to_vec ( ) ,
104
+ penalty_txid : t
105
+ . penalty_tx
106
+ . compute_txid ( )
107
+ . to_raw_hash ( )
108
+ . to_byte_array ( )
109
+ . to_vec ( ) ,
100
110
penalty_rawtx : consensus:: serialize ( & t. penalty_tx ) ,
101
111
}
102
112
}
Original file line number Diff line number Diff line change @@ -189,8 +189,7 @@ impl Blockchain {
189
189
}
190
190
191
191
pub fn generate ( & mut self , txs : Option < Vec < Transaction > > ) -> Block {
192
- // FIXME: replace this magic number with something meaningul
193
- let bits = bitcoin:: CompactTarget :: from_consensus ( 553713663 ) ;
192
+ let bits = bitcoin:: Target :: from_be_bytes ( [ 0xff ; 32 ] ) . to_compact_lossy ( ) ;
194
193
195
194
let prev_block = self . blocks . last ( ) . unwrap ( ) ;
196
195
let prev_blockhash = prev_block. block_hash ( ) ;
You can’t perform that action at this time.
0 commit comments