fix for empty coins in Plus()

This commit is contained in:
Ethan Buchman
2017-02-24 17:12:05 -05:00
parent 4fb3924d22
commit fe81f87a13
2 changed files with 21 additions and 14 deletions
+2
View File
@@ -42,6 +42,8 @@ func (coins Coins) IsValid() bool {
}
}
// TODO: handle empty coins!
// Currently appends an empty coin ...
func (coinsA Coins) Plus(coinsB Coins) Coins {
sum := []Coin{}
indexA, indexB := 0, 0