@@ -45,7 +45,7 @@ func WriteCanonicalHash(db ethdb.Writer, hash common.Hash, number uint64) {
4545}
4646
4747// DeleteCanonicalHash removes the number to hash canonical mapping.
48- func DeleteCanonicalHash (db ethdb.Deleter , number uint64 ) {
48+ func DeleteCanonicalHash (db ethdb.Writer , number uint64 ) {
4949 if err := db .Delete (headerHashKey (number )); err != nil {
5050 log .Crit ("Failed to delete number to hash mapping" , "err" , err )
5151 }
@@ -180,7 +180,7 @@ func WriteHeader(db ethdb.Writer, header *types.Header) {
180180}
181181
182182// DeleteHeader removes all block header data associated with a hash.
183- func DeleteHeader (db ethdb.Deleter , hash common.Hash , number uint64 ) {
183+ func DeleteHeader (db ethdb.Writer , hash common.Hash , number uint64 ) {
184184 deleteHeaderWithoutNumber (db , hash , number )
185185 if err := db .Delete (headerNumberKey (hash )); err != nil {
186186 log .Crit ("Failed to delete hash to number mapping" , "err" , err )
@@ -189,7 +189,7 @@ func DeleteHeader(db ethdb.Deleter, hash common.Hash, number uint64) {
189189
190190// deleteHeaderWithoutNumber removes only the block header but does not remove
191191// the hash to number mapping.
192- func deleteHeaderWithoutNumber (db ethdb.Deleter , hash common.Hash , number uint64 ) {
192+ func deleteHeaderWithoutNumber (db ethdb.Writer , hash common.Hash , number uint64 ) {
193193 if err := db .Delete (headerKey (number , hash )); err != nil {
194194 log .Crit ("Failed to delete header" , "err" , err )
195195 }
@@ -240,7 +240,7 @@ func WriteBody(db ethdb.Writer, hash common.Hash, number uint64, body *types.Bod
240240}
241241
242242// DeleteBody removes all block body data associated with a hash.
243- func DeleteBody (db ethdb.Deleter , hash common.Hash , number uint64 ) {
243+ func DeleteBody (db ethdb.Writer , hash common.Hash , number uint64 ) {
244244 if err := db .Delete (blockBodyKey (number , hash )); err != nil {
245245 log .Crit ("Failed to delete block body" , "err" , err )
246246 }
@@ -278,7 +278,7 @@ func WriteTd(db ethdb.Writer, hash common.Hash, number uint64, td *big.Int) {
278278}
279279
280280// DeleteTd removes all block total difficulty data associated with a hash.
281- func DeleteTd (db ethdb.Deleter , hash common.Hash , number uint64 ) {
281+ func DeleteTd (db ethdb.Writer , hash common.Hash , number uint64 ) {
282282 if err := db .Delete (headerTDKey (number , hash )); err != nil {
283283 log .Crit ("Failed to delete block total difficulty" , "err" , err )
284284 }
@@ -347,7 +347,7 @@ func WriteReceipts(db ethdb.Writer, hash common.Hash, number uint64, receipts ty
347347}
348348
349349// DeleteReceipts removes all receipt data associated with a block hash.
350- func DeleteReceipts (db ethdb.Deleter , hash common.Hash , number uint64 ) {
350+ func DeleteReceipts (db ethdb.Writer , hash common.Hash , number uint64 ) {
351351 if err := db .Delete (blockReceiptsKey (number , hash )); err != nil {
352352 log .Crit ("Failed to delete block receipts" , "err" , err )
353353 }
@@ -378,7 +378,7 @@ func WriteBlock(db ethdb.Writer, block *types.Block) {
378378}
379379
380380// DeleteBlock removes all block data associated with a hash.
381- func DeleteBlock (db ethdb.Deleter , hash common.Hash , number uint64 ) {
381+ func DeleteBlock (db ethdb.Writer , hash common.Hash , number uint64 ) {
382382 DeleteReceipts (db , hash , number )
383383 DeleteHeader (db , hash , number )
384384 DeleteBody (db , hash , number )
@@ -387,7 +387,7 @@ func DeleteBlock(db ethdb.Deleter, hash common.Hash, number uint64) {
387387
388388// deleteBlockWithoutNumber removes all block data associated with a hash, except
389389// the hash to number mapping.
390- func deleteBlockWithoutNumber (db ethdb.Deleter , hash common.Hash , number uint64 ) {
390+ func deleteBlockWithoutNumber (db ethdb.Writer , hash common.Hash , number uint64 ) {
391391 DeleteReceipts (db , hash , number )
392392 deleteHeaderWithoutNumber (db , hash , number )
393393 DeleteBody (db , hash , number )
0 commit comments