• R/O
  • HTTP
  • SSH
  • HTTPS

vapor: 提交

Golang implemented sidechain for Bytom


Commit MetaInfo

修订版2837760a44be12216e623f3489ff7c5c6788abd9 (tree)
时间2020-02-15 19:43:10
作者HAOYUatHZ <haoyu@prot...>
CommiterHAOYUatHZ

Log Message

golint

更改概述

差异

--- a/config/config.go
+++ b/config/config.go
@@ -244,6 +244,7 @@ func DefaultWalletConfig() *WalletConfig {
244244 }
245245 }
246246
247+// Default configurable websocket parameters.
247248 func DefaultWebsocketConfig() *WebsocketConfig {
248249 return &WebsocketConfig{
249250 MaxNumWebsockets: 25,
@@ -251,6 +252,7 @@ func DefaultWebsocketConfig() *WebsocketConfig {
251252 }
252253 }
253254
255+// Default configurable federation parameters.
254256 func DefaultFederationConfig() *FederationConfig {
255257 return &FederationConfig{
256258 Xpubs: []chainkd.XPub{
@@ -263,6 +265,7 @@ func DefaultFederationConfig() *FederationConfig {
263265 }
264266 }
265267
268+// Default configurable crosschain parameters.
266269 func DefaultCrossChainConfig() *CrossChainConfig {
267270 return &CrossChainConfig{}
268271 }
--- a/protocol/asset_filter.go
+++ b/protocol/asset_filter.go
@@ -11,6 +11,8 @@ type assetFilter struct {
1111 whitelist map[string]struct{}
1212 }
1313
14+// NewAssetFilter returns a assetFilter according a whitelist,
15+// which is a strings list cancated via comma
1416 func NewAssetFilter(whitelist string) *assetFilter {
1517 af := &assetFilter{whitelist: make(map[string]struct{})}
1618 af.whitelist[consensus.BTMAssetID.String()] = struct{}{}
@@ -20,6 +22,9 @@ func NewAssetFilter(whitelist string) *assetFilter {
2022 return af
2123 }
2224
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
2328 func (af *assetFilter) IsDust(tx *types.Tx) bool {
2429 for _, input := range tx.Inputs {
2530 if _, ok := input.TypedInput.(*types.CrossChainInput); !ok {
Show on old repository browser