From ed76ff2172b7525689275a3db256e82889931323 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 24 Jun 2014 10:34:03 -0500 Subject: [PATCH] Add BIP0023 block proposal fields. This commit adds the optional block proposal fields defined by BIP0023 to the GetBlockTemplateResult and TemplateRequest types. ok @jcvernaleo --- jsoncmd.go | 5 +++++ jsonresults.go | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/jsoncmd.go b/jsoncmd.go index 5a199465..158a157c 100644 --- a/jsoncmd.go +++ b/jsoncmd.go @@ -2185,6 +2185,11 @@ type TemplateRequest struct { // Basic pool extension from BIP 0023. Target string `json:"target,omitempty"` + + // Block proposal from BIP 0023. Data is only provided when Mode is + // "proposal". + Data string `json:"data,omitempty"` + WorkID string `json:"workid,omitempty"` } // isFloatInt64 returns whether the passed float64 is a whole number that safely diff --git a/jsonresults.go b/jsonresults.go index b230c89c..98f07879 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -118,6 +118,10 @@ type GetBlockTemplateResult struct { MinTime int64 `json:"mintime,omitempty"` Mutable []string `json:"mutable,omitempty"` NonceRange string `json:"noncerange,omitempty"` + + // Block proposal from BIP 0023. + Capabilities []string `json:"capabilities,omitempty"` + RejectReasion string `json:"reject-reason,omitempty"` } // GetNetworkInfoResult models the data returned from the getnetworkinfo command.