-
Notifications
You must be signed in to change notification settings - Fork 683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Asset Tx Chaining #237
Conversation
submitting tx twice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😳
|
||
if (mapAssetsAddressAmount[make_pair(assetName, address)] == 0 && | ||
if (mapAssetsAddressAmount.at(pair) < 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should never happen right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can happen, only with chained transactions. It occurs when blocks are being undone because of a chain split
if (!totalInputs.count(outValue.first)) { | ||
std::string errorMsg; | ||
errorMsg = strprintf("Bad Transaction - Trying to create outpoint for asset that you don't have: %s", outValue.first); | ||
return state.DoS(100, false, REJECT_INVALID, "bad-tx-inputs-outputs-mismatch " + errorMsg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copy/pasted error code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The return statements are the same yes, but they return different messages.
src/wallet/wallet.cpp
Outdated
const CAmount &nMaximumAmount, const CAmount &nMinimumSumAmount, | ||
const uint64_t &nMaximumCount, const int &nMinDepth, const int &nMaxDepth) const | ||
{ | ||
if (!AreAssetsDeployed()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this still return RVN coins instead of bailing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with better code. This is a copy paste mistake
src/wallet/wallet.cpp
Outdated
} | ||
|
||
|
||
// setCoinsRet.insert(CInputCoin(out.tx, out.i)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented section still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the commented out code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛓⛓⛓
This PR allows the following to be done with assets before a block is mined.
issue CHAIN 100 , issue CHAIN/A 100, issue CHAIN/B 100
issue CHAIN/A/A ,issue CHAIN/A/A/C
You can also chain reissues of a asset once it is issued in a block
Block Mined that contains the above issues
reissue CHAIN 100 "address", reissue CHAIN 200 "address"
two or more reissues are valid to the chainEnforce all asset transaction OutPoints to contain 0 RVN in them. This will make it so the network wont allow tx's to accidentally spend there assets when spending RVN to an address.
Updated AvailableCoins function to return only asset tx's or rvn tx's depending on flags passed to function. This fixes the asset outpoints showing up in the Send Dialog Coincontrol. Only RVN tx's show up in the Send Dialog Coincontrol box.