tx: prevent getRate from throwing.

This commit is contained in:
Christopher Jeffrey 2017-03-05 17:57:26 -08:00
parent 9e480db00f
commit e9650da89c
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -1935,10 +1935,15 @@ TX.prototype.getRoundFee = function getRoundFee(size, rate) {
*/
TX.prototype.getRate = function getRate(view, size) {
var fee = this.getFee(view);
if (fee < 0)
return 0;
if (size == null)
size = this.getVirtualSize();
return policy.getRate(size, this.getFee(view));
return policy.getRate(size, fee);
};
/**