OmniLayer / omnicore

OmniCore staging tree
http://www.omnilayer.org/
MIT License
760 stars 231 forks source link

The same transaction was successful in the block browser but not in the wallet #959

Open Java1024 opened 5 years ago

Java1024 commented 5 years ago

An address is created in v0.5.0, and then the USDT is transferred to the address, and the transaction is successfully displayed on https://omniexplorer.info/tx/5fe91bd61d20fb59bdbc85214644de70c57813aa642e30b8d645b830fb14c7b9, but it is an invalid transaction in the wallet. And the invaildreason information has been changing, the initial is to indicate that the other party's balance is insufficient.

{ "txid": "5fe91bd61d20fb59bdbc85214644de70c57813aa642e30b8d645b830fb14c7b9", "fee": "0.00035056", "sendingaddress": "1G47mSr3oANXMafVrR8UC4pzV7FEAzo3r9", "referenceaddress": "16m4gNBGfy9xmDyfJm6aryH5v7up7WroBF", "ismine": true, "version": 0, "type_int": 0, "type": "Simple Send", "propertyid": 31, "divisible": true, "amount": "97.00000000", "valid": false, "invalidreason": "Unknown error", "blockhash": "0000000000000000001b69bc9268ced0c668a23c15d399fb6f3c6ea5404be2a8", "blocktime": 1559275102, "positioninblock": 999999, "block": 578625, "confirmations": 15 }

blueambition commented 5 years ago

omnicore.log shows "CreateFundedTransaction: ERROR: sender 1CSbGg9gD2rp6rcYcwrfNsgiTEpgaFygYz has no coins " you can get balance using "listunspent", but you must sum all unspent amount per an address. not ./omnicore-cli -testnet getbalance address。

https://bitcoin.stackexchange.com/questions/10090/how-to-get-an-addresss-balance-with-the-bitcoin-client The concept of an "address balance" is based on confusion. The way Bitcoin is designed, there are three different concepts related: addresses, wallets, and accounts. Wallets are comprised of one or more accounts, each having a balance (which may even be negative). The wallet as a whole has a balance totalling the sum of all accounts (which must always be positive).

Addresses are merely entry points to a wallet; they do not have balances, and should only ever* be used once. Addresses are associated with an account: when coins are received on the address, it credits that account - note that this is a one-way association: the account is not associated with the address, nor the coin received; its balance is simply increased by the amount received. When you spend bitcoins, your wallet chooses coins to spend at (more or less) random, with no concern for how they were received, and will usually use a completely new invisible address internally with itself, that you will not see as an end-user. Overall, these are some of the reasons why it makes little sense to talk about an "address balance".

While it is fairly common that people reuse addresses for deposits or donations, doing so is harmful to yourself and others using Bitcoin in a number of ways which are outside the scope of this question.

Java1024 commented 5 years ago

@BlueAmbition It’s not that I transfer money to someone else, it’s a third-party platform transfer to me, the corresponding transaction record is normal in the block browser, and the wallet balance is also increased, but the wallet installed on my own computer shows that the transaction is invalid. And the balance has not increased, the wallet has been synchronized.

dexX7 commented 5 years ago

Hi @Java1024, according to my book that transaction is valid.

Can you restart Omni Core with -startclean to reparse Omni Layer transactions?