arnaucube
arnaucube/arboPublic Self-hosted repository
Use DefaultThresholdNLeafs if cfg.ThresholdNLeafs is not defined
arnaucube root@arnaucube.com
Fri, 17 Dec 2021 09:57:03 +0100
commit

d56ab859f109acd5b7a72211e295d687eded7262

parent

96ccfdb50f06fd936b0c157a5c5da87f82d35606

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M tree.go → tree.go

@@ -132,6 +132,9 @@ // be ccommited inside this method, if there is a Tree still in the given

// database, it will load it. func NewTreeWithTx(wTx db.WriteTx, cfg Config) (*Tree, error) { // if thresholdNLeafs is set to 0, use the DefaultThresholdNLeafs + if cfg.ThresholdNLeafs == 0 { + cfg.ThresholdNLeafs = DefaultThresholdNLeafs + } t := Tree{db: cfg.Database, maxLevels: cfg.MaxLevels, thresholdNLeafs: cfg.ThresholdNLeafs, hashFunction: cfg.HashFunction} t.emptyHash = make([]byte, t.hashFunction.Len()) // empty