Closed ngtuna closed 5 years ago
After carefully investigating, we decided to keep Key in both RBT and DB are the same that is []byte(pairName) + key (in RBT)
as []byte(pairName) converted to bigInt added same amount to all nodes so that it doesn't affect the comparator function of RBT
Fixed at #602
https://github.com/tomochain/tomochain/blob/tomoX/tomox/orderlist.go#L68
Current
Key (in RBT & DB) = big.Int(OT.slot + price) -> to BigToHash.Bytes() Slot:
Expect Key (in RBT) = price Key (in DB) = []byte(pairName) + key (in RBT) Slot = key.ToBigInt