Bet: Bet is finished but the winner cannot get XCP

Hi, I tried to use betting API and it seems that escrow worked normally when players bet. However, after I broadcasted the result, the winner cannot get XCP from escrow.

Do I need to do extra things to finish the bet?

What I did:

1. Before Brodocasting the game

Transaction
https://blockscan.com/tx?txhash=f2a822fa470a0798b331072fa95c1a0d753563fce873decd3cfec47305112e8f

Operator 1.20819997 XCP
PlayerX 0.05000001 XCP
PlayerY 0.05000000 XCP

2.After Betting

Transactions
https://blockscan.com/tx?txhash=00602c62059c2af5549646d6f1b0d8de1795fbcfa68892bdfcb5c70280f70a06
https://blockscan.com/tx?txhash=1b23d932cfb73a12dc0be593b95164c00524864ee21580c6bf799fd78ed9e045

Operator 1.20819997
PlayerX 0.05000000 // escrow worked properly. 
PlayerY 0.04999997

3. After Brodocasting the game result

Transaction
https://blockscan.com/tx?txhash=a784ce9290153ea296e859385163690976955c1d333c82981c98e3162bc515d9

Operator 1.20819997 // not get operation fee. I expected that was ...? betting quantity was too small so I could not get the fee..?
PlayerX 0.05000000 // Winner but not get reward. I expected that was 0.05000004
PlayerY 0.04999997

Thanks,

I think you want to broadcast a value (like “1”). Did you broadcast a value? 


counterpartyd broadcast --source=BROADCASTADDRESS --text=“A vs. B - A=1, B=2” --value=2


I think the bet has not been closed (i.e. value that you broadcast did not conclude/close it).
https://blockscan.com/address/1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy

Also can you use testnet perhaps, so that you can use regular values (it’s easier to follow questions if values are not tiny).
Hi, Yes, I did. But not sure if it is a proper way or not.

// Broadcast 
curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create_broadcast", "params":{"source":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "fee_fraction":0.05, "text":"A vs. B - A=1, B=2", "timestamp":1419836433, "value":-1}}'

// Bet by playerA 
curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create_bet", "params":{"source":"1KMdf7VWLEBdCo9iwmtpW7kJaSzSAUz2zJ", "feed_address":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "bet_type":2, "deadline":1419937909, "wager_quantity":1, "counterwager_quantity":3, "target_value":2, "expiration":120}}'

// Bet by playerB
curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create_bet", "params":{"source":"143q1MJUTRgsaXEcU86f8mMx6UThZFfW1Y", "feed_address":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "bet_type":2, "deadline":1419937909, "wager_quantity":3, "counterwager_quantity":1, "target_value":1, "expiration":120}}'

// Broadcast the result (The result is 2)
curl http://127.0.0.1:4000/api/ --user rpc:xcppw1234 -H 'Content-Type: application/json; charset=UTF-8' -H 'Accept: application/json, text/javascript' --data-binary '{"jsonrpc":"2.0", "id":0, "method":"create_broadcast", "params":{"source":"1A31xhRp9FyQZXG57hXczaVLkH5Dm3m9jy", "fee_fraction":0.05, "text":"A vs. B - A=1, B=2", "timestamp":1419842706, "value":2}}'

I have two questions.

1. When does the system change to close status? I expected that the trigger is sending a value except for -1 by the operate. 

2. It seems that broadcast does not have ID. Of course tx_hash is a unique key but it is not used when betting. My question is that is it possible to broadcast multiple broadcasts, like game-A and game-B, by one operator (same bitcoin address) ? I wonder how the system distinguish multiple broadcasts when player bet.

Regarding the testnet. Yes I will sync blockchain from now.

Thanks,

@zono,


Testnet is very lightweight, it’s not a full copy of the blockchain so it’s not a problem to run.

Closed status is when a value (see “value” in here: https://github.com/CounterpartyXCP/CommunityWiki/wiki/Enhanced-Feed-Info) that closes the feed is broadcast. On this URL you can see that values 1, 2 or 3 can close/decide.

I think you cannot broadcast multiple events because it would be hard to decide, but you can try on testnet, it’s free :slight_smile: