Skip to content

Commit 15ef85d

Browse files
gijswijsguggero
authored andcommitted
asset: add IsTransferRoot func
IsTransferRoot returns true if this asset represents a root transfer. A root transfer is an asset that is neither a genesis asset nor contains split commitment witness data.
1 parent 581c881 commit 15ef85d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

asset/asset.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,13 @@ func (a *Asset) HasSplitCommitmentWitness() bool {
13831383
return IsSplitCommitWitness(a.PrevWitnesses[0])
13841384
}
13851385

1386+
// IsTransferRoot returns true if this asset represents a root transfer. A root
1387+
// transfer is an asset that is neither a genesis asset nor contains split
1388+
// commitment witness data.
1389+
func (a *Asset) IsTransferRoot() bool {
1390+
return !a.IsGenesisAsset() && !a.HasSplitCommitmentWitness()
1391+
}
1392+
13861393
// IsUnSpendable returns true if an asset uses the un-spendable script key and
13871394
// has zero value.
13881395
func (a *Asset) IsUnSpendable() bool {

0 commit comments

Comments
 (0)