Closed Charleslee522 closed 6 years ago
If Checkpoint
is struct, Source
and Target
types should be hash, not string.. am i right?
@leejames00 It would be better :)
Maybe it can be another approach... How about it? But I am not sure that it makes to improve performance. ~_~
type Checkpoint struct {
Subtracted string // or Hash
Added string // or Hash
}
What is another approach? I didn't get it.
@outsideris I guess, the name of fields?
@anarcher If we use Checkpoint struct, we don't have to parse checkpoint
string every time.
It would be better to name them Source
andTarget
. Later, when we develop TC, we can implement other functions besides boscoin transactions.
I confused that ‘Source’ as SourceCheckpoint :-)
My approach is same as yours :-) haha
type Checkpoint struct {
Hash string // Compound value: "<Subtracted>-<Added>"
Subtracted string
Added string
}
Resolved by #140
Now, checkpoint type is
string
so when we want to use source or target, we have to callParseCheckpoint
method. And checkpoint is used frequently, performance is important. I think if we define theCheckpoint struct
and define related methods then it would be helpful for both performance and code quality.