@@ -67,10 +67,10 @@ private void Init()
67
67
byte [ ] data = fileMan . ReadData ( DbName ) ;
68
68
if ( data is not null && data . Length != 0 )
69
69
{
70
- var stream = new FastStreamReader ( data ) ;
70
+ FastStreamReader stream = new ( data ) ;
71
71
while ( true )
72
72
{
73
- var utxo = new Utxo ( ) ;
73
+ Utxo utxo = new ( ) ;
74
74
if ( stream . TryReadByteArray ( 32 , out byte [ ] hash ) && utxo . TryDeserialize ( stream , out _ ) )
75
75
{
76
76
if ( database . ContainsKey ( hash ) )
@@ -92,7 +92,7 @@ private void Init()
92
92
data = fileMan . ReadData ( CoinBaseDbName ) ;
93
93
if ( data is not null && data . Length != 0 )
94
94
{
95
- var stream = new FastStreamReader ( data ) ;
95
+ FastStreamReader stream = new ( data ) ;
96
96
if ( ! stream . CheckRemaining ( 8 ) )
97
97
{
98
98
return ;
@@ -102,7 +102,7 @@ private void Init()
102
102
int index = 0 ;
103
103
while ( true )
104
104
{
105
- var coinbase = new Transaction ( ) ;
105
+ Transaction coinbase = new ( ) ;
106
106
if ( coinbase . TryDeserialize ( stream , out _ ) )
107
107
{
108
108
coinbaseQueue [ index ++ ] = coinbase ;
@@ -118,10 +118,10 @@ private void Init()
118
118
119
119
private void WriteCoinbaseToDisk ( )
120
120
{
121
- var stream = new FastStream ( coinbaseQueue . Length * 250 ) ;
121
+ FastStream stream = new ( coinbaseQueue . Length * 250 ) ;
122
122
stream . Write ( i1 ) ;
123
123
stream . Write ( i2 ) ;
124
- foreach ( var item in coinbaseQueue )
124
+ foreach ( ITransaction item in coinbaseQueue )
125
125
{
126
126
if ( item is null )
127
127
{
@@ -164,10 +164,10 @@ private void UpdateCoinbase(ITransaction coinbase)
164
164
165
165
private void WriteDbToDisk ( )
166
166
{
167
- var stream = new FastStream ( database . Count * 90 ) ;
168
- foreach ( var item in database )
167
+ FastStream stream = new ( database . Count * 90 ) ;
168
+ foreach ( KeyValuePair < byte [ ] , List < Utxo > > item in database )
169
169
{
170
- foreach ( var item2 in item . Value )
170
+ foreach ( Utxo item2 in item . Value )
171
171
{
172
172
stream . Write ( item . Key ) ;
173
173
item2 . Serialize ( stream ) ;
@@ -182,7 +182,7 @@ public IUtxo Find(TxIn tin)
182
182
{
183
183
if ( database . TryGetValue ( tin . TxHash , out List < Utxo > value ) )
184
184
{
185
- var index = value . FindIndex ( x => x . Index == tin . Index ) ;
185
+ int index = value . FindIndex ( x => x . Index == tin . Index ) ;
186
186
return index < 0 ? null : value [ index ] ;
187
187
}
188
188
else
@@ -238,7 +238,7 @@ public void Undo(ITransaction[] txs, int lastIndex)
238
238
239
239
for ( int i = 1 ; i <= lastIndex ; i ++ )
240
240
{
241
- foreach ( var item in txs [ i ] . TxInList )
241
+ foreach ( TxIn item in txs [ i ] . TxInList )
242
242
{
243
243
IUtxo utxo = Find ( item ) ;
244
244
if ( utxo is not null )
0 commit comments