@@ -78,27 +78,26 @@ func (m *Manager) Export(writer io.WriteSeeker, targetIndex iotago.SlotIndex) er
78
78
func (m * Manager ) exportAccountTree (writer io.WriteSeeker , targetIndex iotago.SlotIndex ) (int , error ) {
79
79
var accountCount int
80
80
81
- if err := m .accountsTree .Stream (func (accountID iotago.AccountID , accountData * accounts.AccountData ) error {
82
- m .LogDebug ("Exporting account" , "accountID" , accountID , "outputID" , accountData .OutputID , "credits.value" , accountData .Credits .Value , "credits.updateSlot" , accountData .Credits .UpdateSlot )
83
-
84
- wasCreatedAfterTargetSlot , _ , err := m .rollbackAccountTo (accountData , targetIndex )
81
+ if err := m .accountsTree .Stream (func (id iotago.AccountID , account * accounts.AccountData ) error {
82
+ wasCreatedAfterTargetSlot , _ , err := m .rollbackAccountTo (account , targetIndex )
85
83
if err != nil {
86
- return ierrors .Wrapf (err , "unable to rollback account %s" , accountID )
84
+ return ierrors .Wrapf (err , "unable to rollback account %s" , id )
87
85
}
88
86
89
- m .LogDebug ("Exporting account after rollback" , "accountID" , accountID , "outputID" , accountData .OutputID , "credits.value" , accountData .Credits .Value , "credits.updateSlot" , accountData .Credits .UpdateSlot )
90
-
91
87
// Account was created after the target slot, so we don't need to export it.
92
88
if wasCreatedAfterTargetSlot {
93
- m .LogDebug ("Exporting account was created after target slot" , "accountID" , accountID , "targetSlot" , targetIndex )
89
+ m .LogTrace ("account was created after target slot" , "id" , id , "targetSlot" , targetIndex )
90
+
94
91
return nil
95
92
}
96
93
97
- if err : = stream .WriteObject (writer , accountData , (* accounts .AccountData ).Bytes ); err != nil {
98
- return ierrors .Wrapf (err , "unable to write account %s" , accountID )
94
+ if err = stream .WriteObject (writer , account , (* accounts .AccountData ).Bytes ); err != nil {
95
+ return ierrors .Wrapf (err , "unable to write account %s" , id )
99
96
}
100
97
accountCount ++
101
98
99
+ m .LogTrace ("exported account" , "id" , id , "account" , account )
100
+
102
101
return nil
103
102
}); err != nil {
104
103
return 0 , ierrors .Wrap (err , "error in streaming account tree" )
0 commit comments