btcd
btcd copied to clipboard
behavior of getblocktemplate regarding segwit
It seems that the present implementation of getblocktemplate ignores the "rules" input completely. How does that affect its output? Does it produce segwit'd output if segwit is active, regardless of the rules? Should it return an error if there is no segwit rule passed in but segwit is active?
It should at least output a !segwit rule if it generates segwit data (aka, hits the code to include the witness portion), true? It looks like no rules are output at present.
Does it produce segwit'd output if segwit is active, regardless of the rules? Should it return an error if there is no segwit rule passed in but segwit is active?
Atm, yes, we'll instead rly on our version bits state to decide if the segwit commitment should be added or not: https://github.com/btcsuite/btcd/blob/master/mining/mining.go#L605
The rules field is present, but not currently observed. PRs accepted to update the logic here