if (program == null) {
throw new IllegalArgumentException("the program id of input must be specified.");
}
+ if (keyIndex == null) {
+ throw new IllegalArgumentException("the key index of input must be specified.");
+ }
if (witnessComponent.getRootPrivateKey() == null) {
throw new IllegalArgumentException("the root private key of input must be specified.");
}
byte[] privateChild;
if (bipProtocol == BIPProtocol.BIP44) {
- privateChild = DerivePrivateKey.bip44derivePrvKey(rootPrvKey, AccountKeySpace, change, controlProgramIndex);
+ privateChild = DerivePrivateKey.bip44derivePrvKey(rootPrvKey, getKeyIndex(), change, controlProgramIndex);
} else {
privateChild = DerivePrivateKey.bip32derivePrvKey(rootPrvKey, getKeyIndex(), AccountKeySpace, controlProgramIndex);
}
input1.setChange(true);\r
input1.setControlProgramIndex(41);\r
input1.setSourceID("0b2cff11d1d056d95237a5f2d06059e5395e86f60e69c1e8201ea624911c0c65");\r
+ input1.setKeyIndex(1);\r
input1.setSourcePosition(0);\r
\r
SpendInput input2 = new SpendInput(assetId1, 70000000000L, "0014bb8a039726df1b649738e9973db14a4b4fd4becf");\r
input2.setChange(true);\r
input2.setControlProgramIndex(26);\r
input2.setSourceID("be0ac837e832c34a02968e54dab4f95cbeceb9fb01cd378310f6ea32219ee29b");\r
+ input2.setKeyIndex(1);\r
input2.setSourcePosition(1);\r
\r
Output output1 = new Output(btmAssetID, 279100000L, "001414d362694eacfa110dc20dec77d610d22340f95b");\r