mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-19 05:35:49 +00:00
Fixes to protobuf building from Gary
This commit is contained in:
parent
775f5241e3
commit
b29f669bca
3
README
3
README
@ -31,3 +31,6 @@ and regenerate:
|
|||||||
|
|
||||||
mvn clean package -DupdateProtobuf
|
mvn clean package -DupdateProtobuf
|
||||||
|
|
||||||
|
For eclipse use the maven plugin and run:
|
||||||
|
|
||||||
|
mvn eclipse:eclipse
|
||||||
|
3
pom.xml
3
pom.xml
@ -165,7 +165,6 @@
|
|||||||
<phase>generate-sources</phase>
|
<phase>generate-sources</phase>
|
||||||
<configuration>
|
<configuration>
|
||||||
<tasks>
|
<tasks>
|
||||||
<mkdir dir="${project.basedir}/src/main/java/com/google/bitcoin/protobuf" />
|
|
||||||
<path id="proto.path">
|
<path id="proto.path">
|
||||||
<fileset dir="src">
|
<fileset dir="src">
|
||||||
<include name="**/*.proto" />
|
<include name="**/*.proto" />
|
||||||
@ -173,7 +172,7 @@
|
|||||||
</path>
|
</path>
|
||||||
<pathconvert pathsep=" " property="proto.files" refid="proto.path" />
|
<pathconvert pathsep=" " property="proto.files" refid="proto.path" />
|
||||||
<exec executable="protoc" failonerror="true">
|
<exec executable="protoc" failonerror="true">
|
||||||
<arg value="--java_out=${project.basedir}/src/main/java/com/google/bitcoin/protobuf" />
|
<arg value="--java_out=${project.basedir}/src" />
|
||||||
<arg value="-I${project.basedir}/src" />
|
<arg value="-I${project.basedir}/src" />
|
||||||
<arg line="${proto.files}" />
|
<arg line="${proto.files}" />
|
||||||
</exec>
|
</exec>
|
||||||
|
@ -25,7 +25,6 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.bitcoinj.wallet.Protos;
|
import org.bitcoinj.wallet.Protos;
|
||||||
import org.bitcoinj.wallet.Protos.TransactionInput.Builder;
|
|
||||||
|
|
||||||
import com.google.bitcoin.core.AddressFormatException;
|
import com.google.bitcoin.core.AddressFormatException;
|
||||||
import com.google.bitcoin.core.ECKey;
|
import com.google.bitcoin.core.ECKey;
|
||||||
@ -108,7 +107,7 @@ public class WalletProtobufSerializer {
|
|||||||
|
|
||||||
// Handle inputs
|
// Handle inputs
|
||||||
for (TransactionInput input : tx.getInputs()) {
|
for (TransactionInput input : tx.getInputs()) {
|
||||||
Builder inputBuilder = Protos.TransactionInput.newBuilder()
|
Protos.TransactionInput.Builder inputBuilder = Protos.TransactionInput.newBuilder()
|
||||||
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes()))
|
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes()))
|
||||||
.setTransactionOutPointHash(ByteString.copyFrom(
|
.setTransactionOutPointHash(ByteString.copyFrom(
|
||||||
input.getOutpoint().getHash().getBytes()))
|
input.getOutpoint().getHash().getBytes()))
|
||||||
@ -203,7 +202,7 @@ public class WalletProtobufSerializer {
|
|||||||
tx.addOutput(output);
|
tx.addOutput(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (txMap.containsKey(tx.getHash())) {
|
if (txMap.containsKey(ByteString.copyFrom(tx.getHash().getBytes()))) {
|
||||||
throw new RuntimeException("Transaction " + tx.getHashAsString() + " appears twice");
|
throw new RuntimeException("Transaction " + tx.getHashAsString() + " appears twice");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user