forked from Qortal/qortal
Fix conversion of double in ElectrumX JSON to long
This commit is contained in:
parent
30d2e4fdac
commit
d59c30757c
@ -1,6 +1,7 @@
|
|||||||
package org.qortal.crosschain;
|
package org.qortal.crosschain;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.net.SocketAddress;
|
import java.net.SocketAddress;
|
||||||
@ -358,7 +359,7 @@ public class ElectrumX extends BitcoinyBlockchainProvider {
|
|||||||
JSONObject outputJson = (JSONObject) outputObj;
|
JSONObject outputJson = (JSONObject) outputObj;
|
||||||
|
|
||||||
String scriptPubKey = (String) ((JSONObject) outputJson.get("scriptPubKey")).get("hex");
|
String scriptPubKey = (String) ((JSONObject) outputJson.get("scriptPubKey")).get("hex");
|
||||||
long value = (long) (((Double) outputJson.get("value")) * 1e8);
|
long value = BigDecimal.valueOf((Double) outputJson.get("value")).setScale(8).unscaledValue().longValue();
|
||||||
|
|
||||||
// address too, if present
|
// address too, if present
|
||||||
List<String> addresses = null;
|
List<String> addresses = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user