mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-24 14:35:53 +00:00
21 lines
481 B
Go
21 lines
481 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"github.com/kaspanet/kaspad/app/appmessage"
|
|
"os"
|
|
)
|
|
|
|
func isUTXOSpendable(entry *appmessage.UTXOsByAddressesEntry, virtualSelectedParentBlueScore uint64, coinbaseMaturity uint64) bool {
|
|
if !entry.UTXOEntry.IsCoinbase {
|
|
return true
|
|
}
|
|
blockBlueScore := entry.UTXOEntry.BlockBlueScore
|
|
return blockBlueScore+coinbaseMaturity < virtualSelectedParentBlueScore
|
|
}
|
|
|
|
func printErrorAndExit(err error) {
|
|
fmt.Fprintf(os.Stderr, "%s\n", err)
|
|
os.Exit(1)
|
|
}
|