generated from bitcoin-sv/template
-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
go-sdk and therefore ARC will use this to calculate appropriate fees:
(uint64(math.Ceil(float64(size) / 1000))) * s.SatoshisBUT in C++ code of the SV Node (which is currently mining blocks for now) it's calculated differently.
Amount CFeeRate::GetFee(size_t nBytes_) const {
assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max()));
int64_t nSize = int64_t(nBytes_);
Amount nFee = nSize * nSatoshisPerK / 1000;
if (nFee == Amount(0) && nSize != 0) {
if (nSatoshisPerK > Amount(0)) {
nFee = Amount(1);
}
if (nSatoshisPerK < Amount(0)) {
nFee = Amount(-1);
}
}
return nFee;
}
The ts-sdk is actually correct:
const fee = Math.ceil((size / 1000) * this.value)The math.ceiling is never called in SV Node, there is no floor!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done