Merge branch 'pay'

This commit is contained in:
Arthur Britto
2012-06-01 18:04:27 -07:00
10 changed files with 355 additions and 57 deletions

View File

@@ -305,6 +305,45 @@ Transaction::pointer Transaction::sharedTransitSet(
return tResult->setTransitSet(naPrivateKey, uTransitRate, uTransitStart, uTransitExpire);
}
//
// WalletAdd
//
Transaction::pointer Transaction::setWalletAdd(
const NewcoinAddress& naPrivateKey,
const STAmount& saAmount,
const NewcoinAddress& naAuthKeyID,
const NewcoinAddress& naNewPubKey,
const std::vector<unsigned char>& vucSignature)
{
mTransaction->setITFieldAmount(sfAmount, saAmount);
mTransaction->setITFieldAccount(sfAuthorizedKey, naAuthKeyID);
mTransaction->setITFieldVL(sfPubKey, naNewPubKey.getAccountPublic());
mTransaction->setITFieldVL(sfSignature, vucSignature);
sign(naPrivateKey);
return shared_from_this();
}
Transaction::pointer Transaction::sharedWalletAdd(
const NewcoinAddress& naPublicKey, const NewcoinAddress& naPrivateKey,
const NewcoinAddress& naSourceAccount,
uint32 uSeq,
const STAmount& saFee,
uint32 uSourceTag,
const STAmount& saAmount,
const NewcoinAddress& naAuthKeyID,
const NewcoinAddress& naNewPubKey,
const std::vector<unsigned char>& vucSignature)
{
pointer tResult = boost::make_shared<Transaction>(ttWALLET_ADD,
naPublicKey, naSourceAccount,
uSeq, saFee, uSourceTag);
return tResult->setWalletAdd(naPrivateKey, saAmount, naAuthKeyID, naNewPubKey, vucSignature);
}
//
// Misc.
//