Golang implemented sidechain for Bytom
修订版 | 2837760a44be12216e623f3489ff7c5c6788abd9 (tree) |
---|---|
时间 | 2020-02-15 19:43:10 |
作者 | HAOYUatHZ <haoyu@prot...> |
Commiter | HAOYUatHZ |
golint
@@ -244,6 +244,7 @@ func DefaultWalletConfig() *WalletConfig { | ||
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
247 | +// Default configurable websocket parameters. | |
247 | 248 | func DefaultWebsocketConfig() *WebsocketConfig { |
248 | 249 | return &WebsocketConfig{ |
249 | 250 | MaxNumWebsockets: 25, |
@@ -251,6 +252,7 @@ func DefaultWebsocketConfig() *WebsocketConfig { | ||
251 | 252 | } |
252 | 253 | } |
253 | 254 | |
255 | +// Default configurable federation parameters. | |
254 | 256 | func DefaultFederationConfig() *FederationConfig { |
255 | 257 | return &FederationConfig{ |
256 | 258 | Xpubs: []chainkd.XPub{ |
@@ -263,6 +265,7 @@ func DefaultFederationConfig() *FederationConfig { | ||
263 | 265 | } |
264 | 266 | } |
265 | 267 | |
268 | +// Default configurable crosschain parameters. | |
266 | 269 | func DefaultCrossChainConfig() *CrossChainConfig { |
267 | 270 | return &CrossChainConfig{} |
268 | 271 | } |
@@ -11,6 +11,8 @@ type assetFilter struct { | ||
11 | 11 | whitelist map[string]struct{} |
12 | 12 | } |
13 | 13 | |
14 | +// NewAssetFilter returns a assetFilter according a whitelist, | |
15 | +// which is a strings list cancated via comma | |
14 | 16 | func NewAssetFilter(whitelist string) *assetFilter { |
15 | 17 | af := &assetFilter{whitelist: make(map[string]struct{})} |
16 | 18 | af.whitelist[consensus.BTMAssetID.String()] = struct{}{} |
@@ -20,6 +22,9 @@ func NewAssetFilter(whitelist string) *assetFilter { | ||
20 | 22 | return af |
21 | 23 | } |
22 | 24 | |
25 | +// IsDust implements the DustFilterer interface. | |
26 | +// It filters a transaction as long as there is one asset neither BTM or in the whitelist | |
27 | +// No need to check the output assets types becauese they must have been cover in input assets types | |
23 | 28 | func (af *assetFilter) IsDust(tx *types.Tx) bool { |
24 | 29 | for _, input := range tx.Inputs { |
25 | 30 | if _, ok := input.TypedInput.(*types.CrossChainInput); !ok { |