mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 07:48:44 +00:00
24 lines
510 B
Go
24 lines
510 B
Go
package templatemanager
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/app/appmessage"
|
|
"sync"
|
|
)
|
|
|
|
var currentTemplate *appmessage.GetBlockTemplateResponseMessage
|
|
var lock = &sync.Mutex{}
|
|
|
|
// Get returns the template to work on
|
|
func Get() *appmessage.GetBlockTemplateResponseMessage {
|
|
lock.Lock()
|
|
defer lock.Unlock()
|
|
return currentTemplate
|
|
}
|
|
|
|
// Set sets the current template to work on
|
|
func Set(template *appmessage.GetBlockTemplateResponseMessage) {
|
|
lock.Lock()
|
|
defer lock.Unlock()
|
|
currentTemplate = template
|
|
}
|