@@ -25,29 +25,13 @@ impl State {
25
25
pub ( crate ) fn new ( network : Network , version : usize , fail_lock_unspent : bool ) -> Self {
26
26
let mut hashes = Vec :: new ( ) ;
27
27
let mut blocks = BTreeMap :: new ( ) ;
28
- let mut transactions = BTreeMap :: new ( ) ;
29
- let mut utxos = BTreeMap :: new ( ) ;
30
28
31
29
let genesis_block = bitcoin:: blockdata:: constants:: genesis_block ( network) ;
32
30
let genesis_block_hash = genesis_block. block_hash ( ) ;
33
- let genesis_transaction = genesis_block. coinbase ( ) . unwrap ( ) . clone ( ) ;
34
31
35
32
hashes. push ( genesis_block_hash) ;
36
33
blocks. insert ( genesis_block_hash, genesis_block) ;
37
34
38
- transactions. insert (
39
- genesis_transaction. compute_txid ( ) ,
40
- genesis_transaction. clone ( ) ,
41
- ) ;
42
-
43
- utxos. insert (
44
- OutPoint {
45
- txid : genesis_transaction. compute_txid ( ) ,
46
- vout : 0 ,
47
- } ,
48
- Amount :: from_sat ( 50 * COIN_VALUE ) ,
49
- ) ;
50
-
51
35
Self {
52
36
blocks,
53
37
change_addresses : BTreeSet :: new ( ) ,
@@ -60,9 +44,9 @@ impl State {
60
44
network,
61
45
nonce : 0 ,
62
46
receive_addresses : BTreeSet :: new ( ) ,
63
- transactions,
47
+ transactions : BTreeMap :: new ( ) ,
64
48
txid_to_block_height : BTreeMap :: new ( ) ,
65
- utxos,
49
+ utxos : BTreeMap :: new ( ) ,
66
50
version,
67
51
wallet : Wallet :: new ( network) ,
68
52
wallets : BTreeSet :: new ( ) ,
0 commit comments