forked from mycelium-com/wallet-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge https://github.com/kallerosenbaum/wallet into pop
- Loading branch information
Showing
16 changed files
with
324 additions
and
351 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
public/bitlib/src/main/java/com/mrd/bitlib/PopBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.mrd.bitlib; | ||
|
||
import com.mrd.bitlib.crypto.IPublicKeyRing; | ||
import com.mrd.bitlib.model.NetworkParameters; | ||
import com.mrd.bitlib.model.TransactionOutput; | ||
import com.mrd.bitlib.model.UnspentTransactionOutput; | ||
|
||
import java.util.List; | ||
|
||
public class PopBuilder extends StandardTransactionBuilder { | ||
public PopBuilder(NetworkParameters network) { | ||
super(network); | ||
} | ||
|
||
private static class UnsignedPop extends UnsignedTransaction { | ||
public static final int MAX_LOCK_TIME = 499999999; | ||
private static final int POP_SEQUENCE_NUMBER = 0; | ||
|
||
private UnsignedPop(List<TransactionOutput> outputs, List<UnspentTransactionOutput> funding, IPublicKeyRing keyRing, NetworkParameters network) { | ||
super(outputs, funding, keyRing, network); | ||
} | ||
|
||
@Override | ||
public int getDefaultSequenceNumber() { | ||
return POP_SEQUENCE_NUMBER; | ||
} | ||
|
||
@Override | ||
public int getLockTime() { | ||
return MAX_LOCK_TIME; | ||
} | ||
} | ||
|
||
public UnsignedPop createUnsignedPop(List<TransactionOutput> outputs, List<UnspentTransactionOutput> funding, | ||
IPublicKeyRing keyRing, NetworkParameters network) { | ||
UnsignedPop unsignedPop = new UnsignedPop(outputs, funding, keyRing, network); | ||
|
||
return unsignedPop; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.