Skip to content

Commit

Permalink
feat: add OutputsCapacity method to transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Dec 13, 2020
1 parent 7963ae0 commit 5702cd0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ func (t *Transaction) SizeInBlock() (uint64, error) {
return txSize, nil
}

func (t *Transaction) OutputsCapacity() (totalCapacity uint64) {
for _, output := range t.Outputs {
totalCapacity += output.Capacity
}
return
}

type WitnessArgs struct {
Lock []byte `json:"lock"`
InputType []byte `json:"input_type"`
Expand Down

0 comments on commit 5702cd0

Please sign in to comment.