3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-14 11:15:51 +00:00

Fixes to protobuf building from Gary

This commit is contained in:
Miron Cuperman 2012-01-11 16:04:14 -08:00
parent 775f5241e3
commit b29f669bca
4 changed files with 6 additions and 5 deletions

3
README
View File

@ -31,3 +31,6 @@ and regenerate:
mvn clean package -DupdateProtobuf
For eclipse use the maven plugin and run:
mvn eclipse:eclipse

View File

@ -165,7 +165,6 @@
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="${project.basedir}/src/main/java/com/google/bitcoin/protobuf" />
<path id="proto.path">
<fileset dir="src">
<include name="**/*.proto" />
@ -173,7 +172,7 @@
</path>
<pathconvert pathsep=" " property="proto.files" refid="proto.path" />
<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 line="${proto.files}" />
</exec>

View File

@ -25,7 +25,6 @@ import java.util.HashMap;
import java.util.Map;
import org.bitcoinj.wallet.Protos;
import org.bitcoinj.wallet.Protos.TransactionInput.Builder;
import com.google.bitcoin.core.AddressFormatException;
import com.google.bitcoin.core.ECKey;
@ -108,7 +107,7 @@ public class WalletProtobufSerializer {
// Handle inputs
for (TransactionInput input : tx.getInputs()) {
Builder inputBuilder = Protos.TransactionInput.newBuilder()
Protos.TransactionInput.Builder inputBuilder = Protos.TransactionInput.newBuilder()
.setScriptBytes(ByteString.copyFrom(input.getScriptBytes()))
.setTransactionOutPointHash(ByteString.copyFrom(
input.getOutpoint().getHash().getBytes()))
@ -203,7 +202,7 @@ public class WalletProtobufSerializer {
tx.addOutput(output);
}
if (txMap.containsKey(tx.getHash())) {
if (txMap.containsKey(ByteString.copyFrom(tx.getHash().getBytes()))) {
throw new RuntimeException("Transaction " + tx.getHashAsString() + " appears twice");
}